System for transmitting compressed data if compression ratio is at least preset ratio and pre-compressed data if compression ratio is less than preset ratio

ABSTRACT

A difference/compression ratio calculating means 76 in a data processing means 71 of a data transmitting apparatus according to the present invention calculates an actual difference and an actual compression ratio based on the data length of pre-compression data received from a data source 2 through pre-compression data receiving means 74 and the data length of compressed data outputted from a data compression circuit 67. If the actual difference is equal to or greater than a preset difference α and the actual compression ratio is equal to and greater than a preset compression ratio β, then the compressed data is transmitted to a data destination 3 through a transfer request data output means 79. Otherwise, the pre-compression data is transmitted to the data destination 3. With this arrangement, it is possible to prevent a phenomenon in which the size of compressed data which occupies a storage area in the data destination 3 is substantially the same as the size of uncompressed data which occupies the storage area, and also to avoid wasteful data expansion in the data destination 3.

TECHNICAL FIELD

The present invention relates to an apparatus for and a method oftransmitting data, compressed by a loss-less data compression process,between memories, communication devices (including computer terminals),processors, or a host computer and an external memory.

The present invention further relates to an apparatus for and a methodof recording data, transferred from an external source and compressed bya loss-less data compression process, on a recording medium, and moreparticularly to an apparatus for and a method of recording data in anexternal memory that can be connected to a host computer through aninterface bus, e.g., a magnetic disk device such as a hard disk drive, aflexible disk drive, or the like for recording data on and reproducingdata from a magnetic disk, or an optical disk drive for recording dataon and reproducing data from a recordable optical disk such as amagnetooptical disk, a phase-change disk, or the like.

BACKGROUND ART

Generally, computers have a CPU (central processing unit) for readingprogram instructions stored in a main memory through a memory controlunit and executing the program instructions to process various data andcontrol various devices.

Program instructions are steps of a program (algorithms) for processingdata or the like, and a program is normally composed of programinstructions as a number of steps.

Some computers effect only simple processing according to a registeredsmall-scale program which is composed of a relatively small number ofprogram instructions. In such computers, a program is already registeredin a ROM in the computer. However, a modern computer which carries out anumber of data processing operations and control operations is requiredto have a separate memory means for storing a number of programs anddata having a large data length.

It has been customary to employ an auxiliary memory device such as ahard disk drive, an optical disk drive employing a recordable opticaldisk such as a magnetooptical disk, or a bulk-type semiconductor memory,and connect such an auxiliary memory device to a computer through aninterface bus for storing programs and data of large capacity in theauxiliary memory device. According to selective startup or a readingrequest from an OS (operating system) or an application program, aprogram or data stored in the auxiliary memory device is read into amain memory device for effecting data processing and controllingoperations.

Present trends toward larger-capacity external memory devices haveresulted in various techniques proposed to increase the recordingcapacity of magnetic disks and optical disks.

With the advent of multimedia information processing in recent years,the amount of information required by software applications, e.g., thecapacity of programs and the capacity of data handled by programs, hasincreased at a rate greater than the rate at which the storage capacityof the external memory device increases. Therefore, the data compressiontechnology tends to be more and more important.

One of the data compression techniques which is of the loss-less type(entropy coding or loss-less cording) that causes no data loss isdrawing attention because it can increase an apparent capacity when datais recorded in an external memory device and also can effectively usecommunication lines when data is transmitted.

According to a data compression process based on the loss-less datacompression technique, data is compressed by reducing redundant datacontained in the data. When the compressed data is expanded, theuncompressed data prior to compression is fully restored without anyloss of information.

However, the loss-less data compression technique is of such a naturethat a compression ratio at which to compress data, i.e., the ratio ofthe data length of uncompressed data to the data length of compresseddata, remains unknown until all the data is compressed because thecompression data varies depending on the content of the data to becompressed.

According to the loss-less data compression technique, furthermore,binary bit map data or the like which has a very high level ofredundancy is required to be compressed at a high compression ratio of 5or more. If data that has already been compressed by a certain datacompression process is to be further compressed by the loss-less datacompression process, then the data will be expanded in many cases.Therefore, the loss-less data compression technique is very difficult touse.

In the case where data is compressed at a low compression ratio, e.g.,in the case where compressed data is of a size which is 99% of originaluncompressed data, no merit is attained by data compression since thedata length of the uncompressed data and the data length of thecompressed data remain almost the same though the data is definitelycompressed.

For example, it is assumed that data to be stored in a random-accessexternal memory device such as a magnetic disk drive or the like iscompressed to increase an apparent storage capacity of the externalmemory device. The external memory device stores data in fixed lengths,e.g., blocks of 512 bytes. Therefore, if 1 Kbytes of data are stored inthe external memory device, then they are stored over two blocks.

If such 1 Kbytes of data are compressed and the compressed data has adata length of 512 bytes or less, then the compressed data occupies oneblock of storage area on the disk. Therefore, the size of storage areawhich is occupied on the disk by the compressed data is 1/2 of the sizeof storage area which is occupied on the disk by the uncompressed data,an advantage that is offered by the data compression.

However, if the compressed data has a data length greater than 512bytes, then the compressed data actually occupies two blocks of storagearea on the disk even though the data has been compressed, and the sizeof storage area which is occupied on the disk by the compressed data isthe same as the size of storage area which is occupied on the disk bythe uncompressed data.

In such a case, the entire system only causes a wasteful expenditure ofthe time required for data compression (if the data is expanded, thetime required for data compression/expansion), and the electric energyrequired by the CPU and a hardware arrangement dedicated for datacompression, and may possibly suffer poor performance due to the datacompression. If the compressed data is read from the external memorydevice for transmission to the computer, then since the data needs to beexpanded, the time required for expanding the data is also consumedwastefully.

In communications applications where compressed data is divided intopackets of fixed length for transmission, there are instances in whichthe number of packets occupied by uncompressed data and the number ofpackets occupied by compressed data may be the same as each other,posing a limitation on efforts to improve the entire system performance.

If data is compressed according to the loss-less data compressionprocess to shorten a time required to transfer data between a computerand an external memory device for the purpose of using communicationlines more effectively, then a transfer time t_(AC1) required fortransmitting the compressed data is shorter than a transfer time t_(A1)required for transmitting the uncompressed data, as shown in FIG. 43 ofthe accompanying drawings.

When the data is compressed, a time t_(B1) required for datacompression/expansion is newly needed in addition to an actual datatransfer time t_(C1). However, since the data to be actually transmittedis compressed, the apparent data length is reduced. Therefore, the datacompression shortens the transfer time as a whole. In order to shortenthe transfer time, it is necessary to compress the data rapidly toreduce the time t_(B1) required for data compression/expansion.

If the data is compressed at a low compression ratio, then, as shown inFIG. 44 of the accompanying drawings, because an actual data transfertime t_(C2) is not reduced substantially, the addition of a time t_(B2)required for data compression/expansion results in a transfer timet_(AC2) required for transmitting the compressed data which is longerthan a transfer time t_(A2) required for transmitting the uncompresseddata.

Consequently, the data compression does not offer merits, but insteadlowers the overall system performance.

For data transmission between a host computer and an external memorydevice, the host computer performs the above function of loss-less datacompression. With a plurality of external memory devices connected tothe host computer, however, a long calculating time is required tocompress data for transmitting different data from the host computer tothe plural external memory devices, and hence a considerable period oftime is necessary until the transfer of data to all the external memorydevices is completed.

Stated otherwise, for transmitting different data from the host computerto the plural external memory devices, the host computer is tied up withthe data compression, and cannot perform other processing.

Naturally, the apparent storage capacity of only those external memorydevices which are connected to a host computer capable of compressingdata can be increased. That is, only those external memory devicesconnected to a host computer capable of compressing data are given theadvantages of data compression. An external memory device having a diskon which compressed data is recorded can be operation for datareproduction by only a host computer capable of expanding compresseddata.

If an external memory device incorporates a data compression functionfor allowing individual external memory devices to compress data, thenthe time required for a host computer to compress data can beeliminated, and a host computer having no data compression capabilitycan enjoy the advantages of data compression at external memory devices,i.e., an increased apparent storage capacity. Such a host computer isthen able to handle various programs and data.

A data compression function that can be incorporated in an externalmemory device may be performed by a loss-less data compression techniqueby which expanded data is made exactly the same as input data, e.g., theknown Huffmann coding technique or LZW (Lempel-Ziv and Welch) codingtechnique, rather than a data compression technique that causes a dataloss, which is used to compress digital audio data converted from analogaudio data or digital image data, e.g., the known discrete cosine codingtechnique. If such a loss-less data compression technique is employed,then the compression ratio varies depending on the contents of supplieddata, e.g., depending on how much the same words, the same expressions,etc. are used in the data.

Specifically, if it is assumed that a compression ratio to be expected(hereinafter referred to as an "expected compression ratio") whenuncompressed data is compressed by the loss-less data compressiontechnique has a value of 2, then when one logic block of data having acertain data length which is transferred from a host computer iscompressed by an external memory device, the compressed data has a datalength equal to one physical block whose size is 1/2 of one logic blockprovided the data is compressed as expected, i.e., the data iscompressed at the same compression ratio as the expected compressionratio. In this instance, two physical blocks are equal to one logicblock.

Therefore, an optical disk having a physical capacity of 500 MB(MegaByte) has an apparent capacity of 1 GB (GigaByte) as seen from thehost computer. However, when the loss-less data compression technique isemployed, since the data length of compressed data may not necessarilybe 1/2 or less of the data length of the uncompressed data, one logicblock of transferred data may not be contained within one physicalblock.

Inasmuch as data compression may possibly result in data expansion, onelogic block of data may be expanded into data over three or morephysical blocks. Such a phenomenon occurs when an actual compressionratio is less than 1.

In this case, the system performance is lowered regardless of efforts toincrease the performance by increasing the apparent capacity by way ofdata compression. Specifically, even though data is compressed, aphysical capacity which the compressed data occupies on an optical diskremains the same as or is greater than the capacity of one logic block.When the compressed data is to be read, a time is required to expand thecompressed data. Consequently, the compressed data occupies the samespace on the optical disk as would if the data were not compressed, andan additional time is needed to expand the compressed data when it is tobe read. As a result, it is possible for the system to fail to offer anyadvantages from data compression.

Data is randomly recorded on and reproduced from a magnetic disk or anoptical disk. For recording compressed data over two or more physicalblocks on an optical disk, for example, the data is randomly recorded inphysical blocks, for example.

There are occasions where mutually related compressed data over two ormore physical blocks are recorded in physical blocks at spatially spacedpositions on a magnetic or optical disk. Such instances manifestthemselves where data is to be randomly recorded on a magnetic oroptical disk on which data has already been recorded. When data are tobe read from the magnetic or optical disk, a seeking (searching) processfor searching for the mutually related compressed data istime-consuming, resulting in a long access time.

The present invention has been made in view of the above problems. It isan object of the present invention to provide an apparatus for and amethod of transmitting data for increasing overall system performance bytransmitting either uncompressed data or compressed data based on thedata length of the uncompressed data, the data length of the compresseddata, and a preset condition.

Another object of the present invention is to provide an apparatus forand a method of recording data for making it unnecessary to expandrecorded data, of the data recorded on a recording medium, whose actualcompression ratio satisfies a certain condition, so that the data can beread from the recording medium at a greatly increased rate.

Still another object of the present invention is to provide an apparatusfor and a method of recording data for preventing two or more physicalblocks of data from being recorded in physical blocks at physicallyspaced positions, but recording them in areas corresponding to two ormore successive physical blocks for thereby effectively shortening aseek time consumed for reading data.

DISCLOSURE OF THE INVENTION

An apparatus for transmitting data according to the present inventioncomprises pre-compression data holding means for holding pre-compressiondata, data compressing means for compressing the pre-compression dataheld by the pre-compression data holding means, compressed data holdingmeans for holding compressed data from the data compressing means,decision means for determining data to be transmitted, based on datalengths of the pre-compression data and the compressed data and a presetcondition, and data transmitting means for transmitting either one ofthe pre-compression data held by the pre-compression data holding meansand the compressed data held by the compressed data holding means, basedon the data determined by the decision means.

The pre-compression data held by the pre-compression data holding meansis compressed by the data compressing means, and the compressed data isheld by the compressed data holding means.

The decision means determines data to be transmitted, based on datalengths of the pre-compression data and the compressed data and a presetcondition. Based on the data determined by the decision means, the datatransmitting means transmits either one of the pre-compression data andthe compressed data.

For example, if the preset condition is satisfied, then the compresseddata is transmitted, and if the preset condition is not satisfied, thenthe pre-compression data is transmitted.

As a result, it is possible to prevent a phenomenon in which the size ofcompressed data which occupies a storage area in a data destination issubstantially the same as the size of uncompressed data which occupiesthe storage area, and also to avoid wasteful data expansion in the datadestination.

The decision means may comprise means for determining the data to betransmitted, based on an actual difference between the data lengths ofthe pre-compression data and the compressed data and a presetdifference, determining the data to be transmitted as the compresseddata if the actual difference is at least the preset difference, anddetermining the data to be transmitted as the pre-compression data ifthe actual difference is smaller than the preset difference.

Alternatively, the decision means may comprise means for determining thedata to be transmitted, based on an actual compression ratio of the datalength of the pre-compression data to the data length of the compresseddata and a preset compression ratio, determining the data to betransmitted as the compressed data if the actual compression ratio is atleast the preset compression ratio, and determining the data to betransmitted as the pre-compression data if the actual compression ratiois smaller than the preset compression ratio.

Further alternatively, the decision means may comprise means fordetermining the data to be transmitted as the compressed data if anactual difference between the data lengths of the pre-compression dataand the compressed data is at least a preset difference and also if anactual compression ratio of the data length of the pre-compression datato the data length of the compressed data is at least a presetcompression ratio, and determining the data to be transmitted as thepre-compression data otherwise.

It is assumed that an arrangement is employed to transfer compresseddata when the actual difference is at least the preset difference. Withthe preset difference being 512 bytes, for example, if thepre-compression data has a data length of 2 Kbytes, then compressed datais transferred when the data length of the compressed data is 1.5 Kbytesor shorter.

Similarly, if the pre-compression data has a data length of 1 Mbytes(1000 Kbytes), then compressed data is transferred when the data lengthof the compressed data is 999.5 Kbytes or shorter.

The ratio (actual compression ratio) of the pre-compression data (datalength=1000 Kbytes) to the compressed data (data length=999.5 Kbytes) isabout 1.0005, and the percentage of the data length (corresponding tothe data length difference) removed by the data compression with respectto the data length of the pre-compression data is only 0.05%. With thiscompression ratio, the data length of the compressed data remainssubstantially the same as the data length of the pre-compression data.

Consequently, when it is determined whether the compressed data or thepre-compression data is to be transferred based on only the comparisonbetween the actual difference and the preset difference, if the actualdifference is equal to or greater than the preset difference, then thecompressed data is transferred even though the data length of thecompressed data remains substantially the same as the data length of thepre-compression data. As a consequence, the compressed data needs to beexpanded over a period of time which is not short, resulting in awasteful expenditure of time.

According to the above decision process, however, compressed data istransferred only when the actual difference is at least the presetdifference and the actual compression ratio is at least the presetcompression ratio, as described above. Thus, even when the actualdifference is at least the preset difference, no compressed data istransferred, but the pre-compression data is transferred, if the actualcompression ratio is smaller than the preset compression ratio. In thiscase, no time-consuming data expansion process is carried out in thedata destination, so that any wasteful expenditure of time occurs in thedata destination. In this manner, the overall system performance isimproved.

The decision means may comprise means for determining whether an actualcompression ratio of the data length of the pre-compression data to thedata length of the compressed data satisfies either one of two presetconditions, determining the data to be transmitted as thepre-compression data if the actual compression ratio satisfies one ofthe two conditions, and determining the data to be transmitted as thecompressed data if the actual compression ratio satisfies the other ofthe two conditions.

The above one of the two conditions may be 0<the actual compressionratio ε<β(ε-1) and the other of the two conditions may be the actualcompression ratio ε≧β(β-1) where β is a compression ratio to be expectedwhen the pre-compression data is compressed.

The data transmitting apparatus may further comprise preset valuechanging means for changing the preset compression ratio or the presetdifference and the preset compression ratio and the preset difference tooptional values. With the preset value changing means, it is possible tochange the preset difference and the preset compression ratio which havebeen set for shipment into a preset difference and a preset compressionratio that have been logically or experimentally established on a system(hardware and software) created by the operator (user). As aconsequence, data can be compressed under data compressing conditionsoptimum for the system created by the operator (user), making itpossible to improve the quality of file management. This leads to anincrease in the overall system performance.

To achieve the above object, there is also provided in accordance withthe present invention an apparatus for transmitting data, comprisingpre-compression data holding means for holding pre-compression data,data compressing means for compressing the pre-compression data held bythe pre-compression data holding means in units of a predetermined datalength, compressed data holding means for holding compressed data fromthe data compressing means, decision means for determining data to betransmitted, based on a data length of partial compressed data producedby compressing a portion of the pre-compression data with the datacompressing means, a data length of the portion of the pre-compressiondata, and a preset condition, and data transmitting means fortransmitting either one of the pre-compression data held by thepre-compression data holding means and the compressed data held by thecompressed data holding means, based on the data determined by thedecision means.

The pre-compression data held by the pre-compression data holding meansis compressed in units of a predetermined data length by the datacompressing means, and the compressed data is successively by thecompressed data holding means.

The decision means determines data to be transmitted, based on a datalength of partial compressed data produced by compressing a portion ofthe pre-compression data with the data compressing means, a data lengthof the portion of the pre-compression data, and a preset condition.Based on the data determined by the decision means, either one of thepre-compression data and the compressed data is transmitted from thedata transmitting means.

For example, if the preset condition is satisfied, then the compresseddata is transmitted, and if the preset condition is not satisfied, thenthe pre-compression data is transmitted.

As a result, it is possible to prevent a phenomenon in which the size ofcompressed data which occupies a storage area in a data destination issubstantially the same as the size of uncompressed data which occupiesthe storage area, and also to avoid wasteful data expansion in the datadestination.

With this arrangement, not all the pre-compression data is compressed,but data to be transmitted is determined based on a data length ofpartial compressed data produced by compressing a portion of thepre-compression data with the data compressing means, a data length ofthe portion of the pre-compression data, and a preset condition.Therefore, it is possible to shorten the time required to compress thedata.

The data transmitting apparatus may further comprise data deleting meansfor successively deleting the pre-compression data compressed by thedata compressing means. This allows the pre-compression data holdingmeans to be used highly efficiently and a system shutdown due to astorage capacity shortage can be avoided.

The decision means may comprise means for determining the data to betransmitted, based on a predicted compression ratio of the data lengthof the portion of the pre-compression data to the data length of thepartial compressed data, and a preset compression ratio, determining thedata to be transmitted as the compressed data if the predictedcompression ratio is at least the preset compression ratio, anddetermining the data to be transmitted as the pre-compression data ifthe predicted compression ratio is smaller than the preset compressionratio.

The data compressing means may comprise means for stopping compressingthe pre-compression data after the portion of the pre-compression datais compressed when the decision means determines the data to betransmitted as the pre-compression data. In this case, since thepre-compression data is not compressed after the portion of thepre-compression data is compressed when the decision means determinesthe data to be transmitted as the pre-compression data, it is possibleto shorten the overall processing time, i.e., the period of time fromthe time when the pre-compression data is compressed to the time whenthe pre-compression data or the compressed data is transmitted.

The data transmitting apparatus may further comprise weighting means forweighting the predicted compression ratio depending on the type of data.With the weighting means, irrespective of the type of data, any error ofthe predicted compression ratio with respect to the expected finalcompression ratio is minimized, thus improving the overall systemperformance.

The data transmitting apparatus may further comprise preset valuechanging means for changing the preset compression ratio to an optionalvalue. With the preset value changing means, it is possible to changethe preset difference and the preset compression ratio which have beenset for shipment into a preset difference and a preset compression ratiothat have been logically or experimentally established on a system(hardware and software) created by the operator (user). As aconsequence, data can be compressed under data compressing conditionsoptimum for the system created by the operator (user), making itpossible to improve the quality of file management. This leads to anincrease in the overall system performance.

To achieve the above object, there is also provided in accordance withthe present invention an apparatus for recording data, comprising datarecording means for recording data on a recording medium, datacompressing means for compressing input data, data holding means forpre-compression data which comprises input data that is not compressedand compressed data from the data compressing means, decision means fordetermining data to be outputted, based on data lengths of thepre-compression data and the compressed data and a preset condition, anddata output means for outputting either one of the pre-compression dataand the compressed data held by the data holding means to the datarecording means, based on the data determined by the decision means.

The pre-compression data held by the data holding means is compressed bythe data compressing means, and the compressed data is held by the dataholding means.

The decision means determines data to be outputted, based on datalengths of the pre-compression data and the compressed data and a presetcondition. Based on the data determined by the decision means, eitherone of the pre-compression data and the compressed data is outputted tothe data recording means by the data output means, and recorded on therecording medium.

For example, if the preset condition is satisfied, then the compresseddata is recorded on the recording medium, and if the preset condition isnot satisfied, then the pre-compression data is recorded on therecording medium.

As a result, it is possible to prevent a phenomenon in which the size ofcompressed data which occupies a storage area in a data destination issubstantially the same as the size of uncompressed data which occupiesthe storage area, and also to avoid wasteful data expansion when data isread from the recording medium.

Specifically, the recorded data with its actual compression ratio notsatisfying the preset condition, among the data recorded on therecording medium, is not required to be expanded, so that the speed atwhich the data is read from the recording medium can be increased.

The decision means may comprise means for determining the data to beoutputted, based on an actual difference between the data lengths of thepre-compression data and the compressed data and a preset difference,determining the data to be outputted as the compressed data if theactual difference is at least the preset difference, and determining thedata to be outputted as the pre-compression data if the actualdifference is smaller than the preset difference. With this arrangement,if the actual difference is equal to or greater than the presetdifference, then the compressed data is recorded on the recordingmedium, and if the actual difference is smaller than the presetdifference, then the pre-compression data is recorded on the recordingmedium.

Alternatively, the decision means may comprise means for determining thedata to be outputted, based on an actual compression ratio of the datalength of the pre-compression data to the data length of the compresseddata and a preset compression ratio, determining the data to beoutputted as the compressed data if the actual compression ratio is atleast the preset compression ratio, and determining the data to beoutputted as the pre-compression data if the actual compression ratio issmaller than the preset compression ratio. With this arrangement, if theactual compression ratio is equal to or greater than the presetcompression ratio, then the compressed data is recorded on the recordingmedium, and if the actual compression ratio is smaller than the presetcompression ratio, then the pre-compression data is recorded on therecording medium.

Further alternatively, the decision means may comprise means fordetermining the data to be outputted as the compressed data if an actualdifference between the data lengths of the pre-compression data and thecompressed data is at least a preset difference and also if an actualcompression ratio of the data length of the pre-compression data to thedata length of the compressed data is at least a preset compressionratio, and determining the data to be outputted as the pre-compressiondata otherwise. With this arrangement, if the actual difference is equalto or greater than the preset difference and also if the actualcompression ratio is equal to or greater than the preset compressionratio, then the compressed data is recorded on the recording medium.Otherwise, the pre-compression data is recorded on the recording medium.

Still further alternatively, the decision means may comprise means fordetermining whether an actual compression ratio of the data length ofthe pre-compression data to the data length of the compressed datasatisfies either one of two preset conditions, determining the data tobe outputted as the pre-compression data if the actual compression ratiosatisfies one of the two conditions, and determining the data to beoutputted as the compressed data if the actual compression ratiosatisfies the other of the two conditions. With this arrangement, if theactual compression ratio satisfies one of the two conditions, then thepre-compression data is recorded on the recording medium, and if theactual compression ratio satisfies the other of the two conditions, thenthe compressed data is recorded on the recording medium.

The above one of the two conditions may be 0<the actual compressionratio ε<β(β-1) and the other of the two conditions may be the actualcompression ratio ε>β(β-1) where β is a compression ratio to be expectedwhen the pre-compression data is compressed.

In this case, the input data is compressed by the data compressingmeans, the compressed data is held by the data holding means, and datawhich is the input data not compressed is held as pre-compression databy the data holding means. The decision means determines therelationship between the actual compression ratio ε and the expectedcompression ratio β in the data compressing means. If the actualcompression ratio ε and the expected compression ratio β are related toeach other as represented by ε≧β(β-1), i.e., if the data length of thecompressed data is substantially smaller than the data length oftransferred data, then the compressed data is outputted to the datarecording means by the data output means. Therefore, the compressed datais recorded on the recording medium by the data recording means.

If the actual compression ratio ε and the expected compression ratio βare related to each other as represented by 0<ε<β(β-1), i.e., if thedata length of the compressed data is substantially the same as orgreater than the data length of the input data, then the pre-compressiondata is outputted to the data recording means by the data output means.Therefore, the pre-compression data is recorded on the recording mediumby the data recording means.

In the data recording apparatus according to the present invention,inasmuch as the data which is the input data not compressed, i.e., thepre-compression data, is recorded on the recording medium if the datalength of the compressed data is substantially the same as or greaterthan the data length of the input data, the data read from the recordingmedium is not required to be expanded subsequently. Consequently, thespeed at which the data is read from the recording medium is increased.

In the data recording apparatus, addresses defined in the input data arereferred to as logic addresses with reference to unit logic blocksdetermined by a data length of the input, and addresses defined byaddress allocation in recording the compressed data on the recordingmedium are referred to as physical addresses with reference to unitphysical blocks determined by the data length of the compressed dataproduced after the input data is compressed at the same actualcompression ratio ε as the expected compression ratio β by the datacompressing means. The data output means comprises means for outputtingthe compressed data or the pre-compression data to the data recordingmeans while specifying a writing physical address of the compressed dataor the pre-compression data. With this arrangement, the data recordingapparatus operates as follows:

Input data of one logic block is compressed by the data compressingmeans, and held as compressed data of one physical block or two or morephysical blocks by the data holding means. Data which is the input datanot compressed is held as pre-compression data of one logic block by thedata holding means.

The decision means determines the relationship between the actualcompression ratio ε and the expected compression ratio β in the datacompressing means. If the actual compression ratio ε and the expectedcompression ratio β are related to each other as represented byε≧β(β-1), i.e., if the size (the number of physical blocks) of thecompressed data is substantially smaller than the size (the number ofphysical blocks making up one logic block) of the input data, then thedata output means specifies a writing physical address and outputs thecompressed data to the data recording means. Therefore, the compresseddata is recorded on the recording medium in an area corresponding to thewriting physical address by the data recording means.

If the actual compression ratio ε and the expected compression ratio βare related to each other as represented by 0<ε<β(β-1), i.e., if thesize (the number of physical blocks) of the compressed data is the sameas or greater than the size (the number of physical blocks making up onelogic block) of the input data, then the data output means specifies awriting physical address and outputs the pre-compression data to thedata recording means. Therefore, the pre-compression data is recorded onthe recording medium in an area corresponding to the writing physicaladdress by the data recording means.

Since the data, i.e., the pre-compression data, which is the input datanot compressed is recorded on the recording medium if the size (thenumber of physical blocks) of the compressed data is the same as orgreater than the size (the number of physical blocks making up one logicblock) of the input data, the data read from the recording medium is notrequired to be expanded subsequently. Consequently, the speed at whichthe data is read from the recording medium is increased.

The data recording apparatus may further comprise recording means forrecording an allocation table representing a correspondence betweenreading logic addresses of the input data and writing physical addressesof the compressed data or the pre-compression data in a predeterminedarea of the recording medium.

When the data output means is to specify a writing physical address andselectively output the compressed data and the pre-compression data tothe data recording means based on the data determined by the decisionmeans, the data output means refers to the writing physical addresscorresponding to the reading logic address of the input data from theallocation table, and outputs the compressed data or the pre-compressiondata while specifying the writing physical address.

Since the data output means can easily confirm, from the allocationtable, the correspondence between logic addresses handled by an externalsource, e.g., a host computer, and physical addresses handled by thedata recording apparatus, the host computer, for example, is notrequired to recognize physical addresses of the recording medium, butcan access the data only with logic addresses through the data recordingapparatus.

The recording apparatus may further comprise table generating means forgenerating a record status table composed of record statuses of datarecorded on the recording medium as bit information in units of physicalblocks, based on the physical addresses registered in the allocationtable.

When the data output means is to specify a writing physical address andselectively output the compressed data and the pre-compression data tothe data recording means, it is possible to determine the physicaladdress while referring to bit information of the record status tablegenerated by the table generating means.

Since the record statuses can be recognized by simple bits of 1/0, thesearch time can be made shorter than if writing physical addresses weredirectly searched while referring physical addresses registered in theallocation table. The time required for program debugging, systemmaintenance, etc. is shorter than if the record statuses were recognizedfrom physical sector addresses having a complex bit arrangement in datastructure.

The data recording apparatus may further comprise individual areasearching means for searching a substantially unrecorded area on therecording medium in units of physical blocks to detect a physicaladdress in the unrecorded area, the data output means comprising meansfor outputting the compressed data or the pre-compression data to thedata recording means while specifying the physical address in theunrecorded area detected by the individual area searching means.

With this arrangement, a substantially recorded area on the recordingmedium is searched in units of physical blocks to detect a physicaladdress in the unrecorded area by the individual area searching means.

Then, the data output means specifies a physical address detected by theindividual area searching means as a writing physical address, andoutputs the compressed data or the pre-compression data to the datarecording means. Consequently, the compressed data or thepre-compression data is recorded in an area corresponding to the writingphysical address on the recording medium by the data recording means.

Inasmuch as the compressed data or the pre-compression data is randomlyrecorded in an optional unrecorded area of unit physical blocks, thisarrangement is advantageous for recording compressed data orpre-compression data having a size of unit physical blocks. Compresseddata or pre-compression data over two or more physical blocks may berecorded in physically spaced positions in units of a physical block.

The data recording apparatus may further comprise successive areasearching means for searching a substantially unrecorded area on therecording medium in units of at least two successive physical blocks todetect a physical address in the unrecorded area if the actualcompression ratio ε is smaller than the predicted compression ratio βand the compressed data extends over at least two physical blocks, thedata output means comprising means for outputting the compressed data orthe pre-compression data to the data recording means while specifyingthe physical address in the unrecorded area detected by the successivearea searching means.

The successive area searching means searches a substantially unrecordedarea on the recording medium in units of at least two successivephysical blocks to detect a physical address in the unrecorded area.

The data output means specifies a physical address detected by thesuccessive area searching means as a writing physical address, andoutputs the compressed data or the pre-compression data over two or morephysical blocks to the data recording means. Consequently, thecompressed data or the pre-compression data is recorded in successiveareas corresponding to the writing physical address on the recordingmedium by the data recording means.

Inasmuch as the compressed data or the pre-compression data over two ormore physical blocks is recorded in successive unrecorded areas, thecompressed data or the pre-compression data over two or more physicalblocks is prevented from being recorded in physically spaced positionsin units of a physical block. Therefore, the seek time for reading datacan effectively be shortened.

The allocation table may have a first registering area in which thereading logic addresses of the input data and the writing physicaladdresses of the compressed data or the pre-compression datacorresponding to the reading logic addresses are registered, and asecond registering area in which the physical addresses of therespective physical blocks, except for a starting physical address, areregistered as respective link addresses if the compressed data or thepre-compression data extends over at least two physical blocks, and thedata recording apparatus may further comprise means for registeringinformation indicative of no link address and decision data representingwhether the data to be recorded on the recording medium is thecompressed data or the pre-compression data, in an area corresponding toa final physical block in the second registering area.

In the data recording apparatus, the compressed data and thepre-compression data are selectively recorded on the recording mediumdepending on the relationship between the actual compression ratio ε andthe predicted compression ratio β in the data compressing means. Theabove process needs new information for distinguishing compressed dataand pre-compression data from each other.

According to the present invention, however, decision data fordistinguishing compressed data and uncompressed data from each other isstored together with information indicative of no link address in anarea corresponding to the final physical block in the second registeringarea of the allocation table. Therefore, it is not necessary to keep astorage area for registering the decision data on the recording medium,with the result that the problem of a reduced data recording capacity isalleviated.

The data transmitting apparatus and the data recording apparatusaccording to the present invention are not limited to embodimentsdescribed below, but may be changed or modified without departing fromthe scope of the present invention.

According to the present invention, there is also provided a method oftransmitting data, comprising the steps of determining data to betransmitted, based on a data length of a pre-compression data which isheld, a data length of compressed data produced by compressing thepre-compression data, and a preset condition, and transmitting eitherone of the pre-compression data and the compressed data based on thedata determined to be transmitted.

For example, if the preset condition is satisfied, then the compresseddata is transmitted, and if the preset condition is not satisfied, thenthe pre-compression data is transmitted.

As a result, it is possible to prevent a phenomenon in which the size ofcompressed data which occupies a storage area in a data destination issubstantially the same as the size of uncompressed data which occupiesthe storage area, and also to avoid wasteful data expansion in the datadestination.

The step of determining may comprise the step of determining the data tobe transmitted, based on an actual difference between the data lengthsof the pre-compression data and the compressed data and a presetdifference, and the step of transmitting may comprise the steps oftransmitting the compressed data if the actual difference is at leastthe preset difference, and transmitting the pre-compression data if theactual difference is smaller than the preset difference.

Alternatively, the step of determining may comprise the step ofdetermining the data to be transmitted, based on an actual compressionratio of the data length of the pre-compression data to the data lengthof the compressed data and a preset compression ratio, and the step oftransmitting may comprise the steps of transmitting the compressed dataif the actual compression ratio is at least the preset compressionratio, and transmitting the pre-compression data if the actualcompression ratio is smaller than the preset compression ratio.

Further alternatively, the step of transmitting comprises the steps oftransmitting the compressed data if an actual difference between thedata lengths of the pre-compression data and the compressed data is atleast a preset difference and also if an actual compression ratio of thedata length of the pre-compression data to the data length of thecompressed data is at least a preset compression ratio, and transmittingthe pre-compression data otherwise.

With such an arrangement, even when the actual difference is at leastthe preset difference, no compressed data is transferred, but thepre-compression data is transferred, if the actual compression ratio issmaller than the preset compression ratio, i.e., if the data length ofthe compressed data remains essentially the same as the data length ofthe pre-compression data. In this case, no time-consuming data expansionprocess is carried out in the data destination, so that any wastefulexpenditure of time occurs in the data destination. In this manner, theoverall system performance is improved.

Still further alternatively, the step of determining may comprise thestep of determining whether an actual compression ratio of the datalength of the pre-compression data to the data length of the compresseddata satisfies either one of two preset conditions, and the step oftransmitting may comprise the steps of transmitting as thepre-compression data if the actual compression ratio satisfies one ofthe two conditions, and transmitting the compressed data if the actualcompression ratio satisfies the other of the two conditions.

The above one of the two conditions may be 0<the actual compressionratio ε<β(β-1) and the other of the two conditions may be the actualcompression ratio ε≧β(β-1) where β is a compression ratio to be expectedwhen the pre-compression data is compressed.

The preset compression ratio or the preset difference and the presetcompression ratio and the preset difference may be changed to optionalvalues. Then, it is possible to change the preset difference and thepreset compression ratio which have been set for shipment into a presetdifference and a preset compression ratio that have been logically orexperimentally established on a system (hardware and software) createdby the operator (user). As a consequence, data can be compressed underdata compressing conditions optimum for the system created by theoperator (user), making it possible to improve the quality of filemanagement. This leads to an increase in the overall system performance.

According to the present invention, there is further provided a methodof transmitting data, comprising the steps of determining data to betransmitted, based on a data length of partial compressed data producedby compressing a portion of pre-compression data which is held, a datalength of the portion of the pre-compression data, and a presetcondition, and transmitting either one of the pre-compression data andthe compressed data based on the data determined to be transmitted.

For example, if the preset condition is satisfied, then the compresseddata is transmitted, and if the preset condition is not satisfied, thenthe pre-compression data is transmitted.

As a result, it is possible to prevent a phenomenon in which the size ofcompressed data which occupies a storage area in a data destination issubstantially the same as the size of uncompressed data which occupiesthe storage area, and also to avoid wasteful data expansion in the datadestination.

According to this method, not all the pre-compression data iscompressed, but data to be transmitted is determined based on a datalength of partial compressed data produced by compressing a portion ofthe pre-compression data with the data compressing means, a data lengthof the portion of the pre-compression data, and a preset condition.Therefore, it is possible to shorten the time required to compress thedata.

In the above method, the compressed portion of the pre-compression datamay successively be deleted. This allows the pre-compression dataholding means to be used highly efficiently and a system shutdown due toa storage capacity shortage can be avoided.

The step of determining may comprise the step of determining the data tobe transmitted, based on a predicted compression ratio of the datalength of the portion of the pre-compression data to the data length ofthe partial compressed data, and a preset compression ratio, and thestep of transmitting may comprise the steps of transmitting thecompressed data if the predicted compression ratio is at least thepreset compression ratio, and transmitting the pre-compression data ifthe predicted compression ratio is smaller than the preset compressionratio.

The method may further comprise the step of stopping compressing thepre-compression data after the portion of the pre-compression data iscompressed when the data to be transmitted is determined as thepre-compression data. In this case, since the pre-compression data isnot compressed after the portion of the pre-compression data iscompressed when the decision means determines the data to be transmittedas the pre-compression data, it is possible to shorten the overallprocessing time, i.e., the period of time from the time when thepre-compression data is compressed to the time when the pre-compressiondata or the compressed data is transmitted.

The method may further comprise the step of weighting the predictedcompression ratio depending on the type of data. With the weightingstep, irrespective of the type of data, any error of the predictedcompression ratio with respect to the expected final compression ratiois minimized, thus improving the overall system performance.

The preset compression ratio may be changed to an optional value. It isthen possible to change the preset difference and the preset compressionratio which have been set for shipment into a preset difference and apreset compression ratio that have been logically or experimentallyestablished on a system (hardware and software) created by the operator(user). As a consequence, data can be compressed under data compressingconditions optimum for the system created by the operator (user), makingit possible to improve the quality of file management. This leads to anincrease in the overall system performance.

According to the present invention, there is also provided a method ofrecording data, comprising the steps of determining data to be recorded,based on a data length of pre-compression data which comprises inputdata that is not compressed, a data length of compressed data whichcomprises input data that is compressed, and a preset condition, andrecording either one of the pre-compression data and the compressed dataon a recording medium based on the data determined to be recorded.

For example, if the preset condition is satisfied, then the compresseddata is recorded on the recording medium, and if the preset condition isnot satisfied, then the pre-compression data is recorded on therecording medium.

As a result, it is possible to prevent a phenomenon in which the size ofcompressed data which occupies a storage area in a data destination issubstantially the same as the size of uncompressed data which occupiesthe storage area, and also to avoid wasteful data expansion when data isread from the recording medium.

Specifically, the recorded data with its actual compression ratio notsatisfying the preset condition, among the data recorded on therecording medium, is not required to be expanded, so that the speed atwhich the data is read from the recording medium can be increased.

The step of determining may comprise the step of determining the data tobe recorded, based on an actual difference between the data lengths ofthe pre-compression data and the compressed data and a presetdifference. If the actual difference is equal to or greater than thepreset difference, the data to be outputted is determined as thecompressed data, and if the actual difference is smaller than the presetdifference, the data to be outputted is determined as thepre-compression data. Therefore, the compressed data is recorded on therecording medium if the actual difference is at least the presetdifference, and the pre-compression data is recorded on the recordingmedium if the actual difference is smaller than the preset difference.

Alternatively, the step of determining may comprise the step ofdetermining the data to be recorded, based on an actual compressionratio of the data length of the pre-compression data to the data lengthof the compressed data and a preset compression ratio, and the step ofrecording may comprise the steps of recording the compressed data if theactual compression ratio is at least the preset compression ratio, andrecording the pre-compression data if the actual compression ratio issmaller than the preset compression ratio.

Further alternatively, the step of recording comprises the steps ofrecording the compressed data if an actual difference between the datalengths of the pre-compression data and the compressed data is at leasta preset difference and also if an actual compression ratio of the datalength of the pre-compression data to the data length of the compresseddata is at least a preset compression ratio, and recording thepre-compression data otherwise.

Still further alternatively, the step of determining comprises the stepof determining whether an actual compression ratio of the data length ofthe pre-compression data to the data length of the compressed datasatisfies either one of two preset conditions, and the step of recordingcomprises the steps of recording the pre-compression data if the actualcompression ratio satisfies one of the two conditions, and recording thecompressed data if the actual compression ratio satisfies the other ofthe two conditions.

The above one of the two conditions may be 0<the actual compressionratio ε<β(β-1) and the other of the two conditions may be the actualcompression ratio ε≧β(β-1) where β is a compression ratio to be expectedwhen the pre-compression data is compressed. If the data length of thecompressed data is substantially the same as or greater than the datalength of the input data, then the data which is the input data notcompressed, i.e., the pre-compression data, is recorded on the recordingmedium. Therefore, the data read from the recording medium is notrequired to be expanded subsequently. Consequently, the speed at whichthe data is read from the recording medium is increased.

In the above data recording method, addresses defined in the input dataare referred to as logic addresses with reference to unit logic blocksdetermined by a data length of the input, and addresses defined byaddress allocation in recording the compressed data on the recordingmedium are referred to as physical addresses with reference to unitphysical blocks determined by the data length of the compressed dataproduced after the input data is compressed at the same actualcompression ratio ε as the expected compression ratio β. The step ofrecording may comprise the step of recording the compressed data or thepre-compression data while specifying a writing physical address of thecompressed data or the pre-compression data.

If the size (the number of physical blocks) of the compressed data issubstantially the same as or greater than the size (the number ofphysical blocks making up one logic block) of the input data, then thedata which is the input data not compressed, i.e., the pre-compressiondata, is recorded on the recording medium. Therefore, the data read fromthe recording medium is not required to be expanded subsequently.Consequently, the speed at which the data is read from the recordingmedium is increased.

The data recording method may further comprise the step of recording anallocation table representing a correspondence between reading logicaddresses of the input data and writing physical addresses of thecompressed data or the pre-compression data in a predetermined area ofthe recording medium.

Since the correspondence between logic addresses and physical addressescan easily be confirmed from the allocation table, an externallyconnected host computer, for example, is not required to recognizephysical addresses of the recording medium, but can access the data onlywith logic addresses.

The data recording method may further comprise the step of generating arecord status table composed of record statuses of data recorded on therecording medium as bit information in units of physical blocks, basedon the physical addresses registered in the allocation table.

Since the record statuses can be recognized by simple bits of 1/0, thesearch time can be made shorter than if writing physical addresses weredirectly searched while referring physical addresses registered in theallocation table. The time required for program debugging, systemmaintenance, etc. is shorter than if the record statuses were recognizedfrom physical sector addresses having a complex bit arrangement in datastructure.

The data recording method may further comprise the step of searching asubstantially unrecorded area on the recording medium in units ofphysical blocks to detect a physical address in the unrecorded area, thestep of recording comprising the step of recording the compressed dataor the pre-compression data while specifying the physical address in theunrecorded area which is detected.

Inasmuch as the compressed data or the pre-compression data is randomlyrecorded in an optional unrecorded area of unit physical blocks, thisarrangement is advantageous for recording compressed data orpre-compression data having a size of unit physical blocks. Compresseddata or pre-compression data over two or more physical blocks may berecorded in physically spaced positions in units of a physical block.

The data recording method may further comprise the step of searching asubstantially unrecorded area on the recording medium in units of atleast two successive physical blocks to detect a physical address in theunrecorded area if the actual compression ratio is smaller than thepredicted compression ratio and the compressed data extends over atleast two physical blocks, and the step of recording may comprise thestep of recording the compressed data or the pre-compression data whilespecifying the physical address in the unrecorded area which isdetected.

Inasmuch as the compressed data or the pre-compression data over two ormore physical blocks is recorded in successive unrecorded areas, thecompressed data or the pre-compression data over two or more physicalblocks is prevented from being recorded in physically spaced positionsin units of a physical block. Therefore, the seek time for reading datacan effectively be shortened.

In the data recording method, furthermore, the allocation table may havea first registering area in which the reading logic addresses of theinput data and the writing physical addresses of the compressed data orthe pre-compression data corresponding to the reading logic addressesare registered, and a second registering area in which the physicaladdresses of the respective physical blocks, except for a startingphysical address, are registered as respective link addresses if thecompressed data or the pre-compression data extends over at least twophysical blocks. The data recording method may further comprise the stepof registering information indicative of no link address and decisiondata representing whether the data to be recorded on the recordingmedium is the compressed data or the pre-compression data, in an areacorresponding to a final physical block in the second registering area.

In the data recording method, the compressed data and thepre-compression data are selectively recorded on the recording mediumdepending on the relationship between the actual compression ratio ε andthe predicted compression ratio β in the data compression. The aboveprocess needs new information for distinguishing compressed data andpre-compression data from each other.

According to the present invention, however, decision data fordistinguishing compressed data and uncompressed data from each other isstored together with information indicative of no link address in anarea corresponding to the final physical block in the second registeringarea of the allocation table. Therefore, it is not necessary to keep astorage area for registering the decision data on the recording medium,with the result that the problem of a reduced data recording capacity isalleviated.

The data transmitting method and the data recording method according tothe present invention are not limited to embodiments described below,but may be changed or modified without departing from the scope of thepresent invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a general mode of use of a datatransmitting apparatus according to the present invention;

FIG. 2 is a block diagram of a first mode of use of the datatransmitting apparatus according to the present invention;

FIG. 3 is a block diagram of a second mode of use of the datatransmitting apparatus according to the present invention;

FIG. 4 is a block diagram of a third mode of use of the datatransmitting apparatus according to the present invention;

FIG. 5 is a block diagram of a fourth mode of use of the datatransmitting apparatus according to the present invention;

FIG. 6 is a block diagram of a fifth mode of use of the datatransmitting apparatus according to the present invention;

FIG. 7 is a block diagram of a sixth mode of use of the datatransmitting apparatus according to the present invention;

FIG. 8 is a block diagram of a hardware arrangement of the datatransmitting apparatus according to the present invention;

FIG. 9 is a functional block diagram showing a processing operation of adata processing means in a data transmitting apparatus according to anembodiment of the present invention which carries out a first processingoperation (hereinafter simply referred to as a "data transmittingapparatus according to a first embodiment");

FIG. 10 is a flowchart (1) of a processing operation of the dataprocessing means in the data transmitting apparatus according to thefirst embodiment;

FIG. 11 is a flowchart (2) of the processing operation of the dataprocessing means in the data transmitting apparatus according to thefirst embodiment;

FIG. 12 is a functional block diagram showing a processing operation ofa data processing means in a data transmitting apparatus according to anembodiment of the present invention which carries out a secondprocessing operation (hereinafter simply referred to as a "datatransmitting apparatus according to a second embodiment");

FIG. 13 is a flowchart (1) of a processing operation of the dataprocessing means in the data transmitting apparatus according to thesecond embodiment;

FIG. 14 is a flowchart (2) of the processing operation of the dataprocessing means in the data transmitting apparatus according to thesecond embodiment;

FIG. 15 is a functional block diagram showing a processing operation ofan expected compression ratio calculating means of the data processingmeans in the data transmitting apparatus according to the secondembodiment;

FIG. 16 is a flowchart of a processing operation of the expectedcompression ratio calculating means of the data processing means in thedata transmitting apparatus according to the second embodiment;

FIG. 17 is a functional block diagram showing a processing operation ofa data compressing means of the data processing means in the datatransmitting apparatus according to the second embodiment;

FIG. 18 is a flowchart of a processing operation of the data compressingmeans of the data processing means in the data transmitting apparatusaccording to the second embodiment;

FIG. 19 is a block diagram of an external memory device (hereinafterreferred to as an "external memory device according to an embodiment")which incorporates a data transmitting apparatus according to anembodiment of the present invention which carries out a third processingoperation (hereinafter simply referred to as a "data transmittingapparatus according to a third embodiment");

FIG. 20 is a block diagram of a hardware arrangement of the datatransmitting apparatus according to the third embodiment;

FIG. 21 is a diagram showing, by way of example, a recording format of amagnetooptical disk loaded in the external memory device according tothe embodiment;

FIG. 22 is a diagram showing a byte arrangement of contents of a DDSsector of attribute data recorded in an attribute data recording area ofthe magnetooptical disk;

FIG. 23 is a diagram showing contents of a DDS sector, particularlycontents of a file allocation table, of the attribute data recorded inthe attribute data recording area of the magnetooptical disk;

FIG. 24 is a functional block diagram showing a processing operation ofa data processing means in the data transmitting apparatus according tothe third embodiment;

FIG. 25 is a flowchart of a processing operation of the data processingmeans in the data transmitting apparatus according to the thirdembodiment;

FIG. 26 is a flowchart of a processing operation of a record statustable generating means of the data processing means in the datatransmitting apparatus according to the third embodiment;

FIG. 27 is a diagram illustrative of contents of a record status tablegenerated by the record status table generating means;

FIG. 28 is a flowchart of a processing operation of a request processingmeans of the data processing means in the data transmitting apparatusaccording to the third embodiment;

FIG. 29 is a functional block diagram showing a processing operation ofan initializing means of the request processing means in the datatransmitting apparatus according to the third embodiment;

FIG. 30 is a flowchart of a processing operation of the initializingmeans of the request processing means in the data transmitting apparatusaccording to the third embodiment;

FIG. 31 is a flowchart of a processing operation of an attribute datawriting means of the initializing means in the data transmittingapparatus according to the third embodiment;

FIG. 32 is a functional block diagram showing a processing operation ofa writing means of the request processing means in the data transmittingapparatus according to the third embodiment;

FIG. 33 is a flowchart of a processing operation of the writing means ofthe request processing means in the data transmitting apparatusaccording to the third embodiment;

FIG. 34 is a flowchart (1) of a processing operation of an FAT (fileallocation table) generating means of the writing means in the datatransmitting apparatus according to the third embodiment;

FIG. 35 is a flowchart (2) of the processing operation of the FATgenerating means of the writing means in the data transmitting apparatusaccording to the third embodiment;

FIG. 36 is a flowchart of a processing operation of an address storingmeans of the FAT generating means in the data transmitting apparatusaccording to the third embodiment;

FIG. 37 is a flowchart of a processing operation of a data output meansof the writing means in the data transmitting apparatus according to thethird embodiment;

FIG. 38 is a functional block diagram showing a processing operation ofa reading means of the request processing means in the data transmittingapparatus according to the third embodiment;

FIG. 39 is a flowchart of a processing operation of the reading means ofthe request processing means in the data transmitting apparatusaccording to the third embodiment;

FIG. 40 is a functional block diagram showing a processing operation ofa data deleting means of the request processing means in the datatransmitting apparatus according to the third embodiment;

FIG. 41 is a flowchart of a processing operation of the data deletingmeans of the request processing means in the data transmitting apparatusaccording to the third embodiment;

FIG. 42 is a diagram showing an apparent logic data recording capacitywith a predicted compression ratio β reduced in a manner to correspondto a reduction in a physical unrecorded data recording capacity on amagnetooptical disk;

FIG. 43 is a diagram illustrative of a transfer time for data compressedaccording to the loss-less data compression technique; and

FIG. 44 is a diagram illustrative of a transfer time for data compressedat a low compression ratio.

BEST MODE FOR CARRYING OUT THE INVENTION Embodiments!

Embodiments of data transmitting apparatus according to the presentinvention will hereinafter be described with reference to FIGS. 1through 42.

As shown in FIG. 1, a data transmitting apparatus 1 according to anembodiment of the present invention is inserted and connected between adata source 2 and a data destination 3. Each of the data source 2 andthe data destination 3 may comprise a data processing system forprocessing an inputted analog signal or digital data with an analogcircuit system or a digital circuit, or a data processing system forprocessing data according to processing steps (program) predetermined bya computer (CPU) and supplying the processed data through an existinginterface circuit to a transmission line (composed of a metal wire oroptical fiber).

Each of the data source 2 and the data destination 3 may alternativelycomprise a one-chip LSI mounted on a printed wiring board, or acommunication device and an external memory device having an internalstorage medium comprising a bulk-type memory such as a semiconductormemory or the like or a disk-shaped recording medium such as an opticaldisk or the like, or a host computer for centralized management of datato be processed.

Modes of use of the data transmitting apparatus!

Specific examples of some modes of use of the data transmittingapparatus 1 will be described below with reference to FIGS. 2 through 7.

In the example shown in FIG. 2, data is transmitted, i.e., data is readand written, between a number of files that are logically developed inone memory 11 through the data transmitting apparatus 1 under thecontrol of a controller 12.

In this mode of use, specifically, the memory 11 and the datatransmitting apparatus 1 are connected to each other through a data bus13, the controller 12 and the data transmitting apparatus 1 areconnected to each other through a control bus 14 and a data bus 15, thememory 11 and the controller 12 are connected to each other through amemory control bus 16 and an address bus 17, and the controller 12 and akey input means 18 such as a keyboard or the like are connected to eachother through an interface bus 19.

When the key input means 18 is operated to enter a file name of the datasource and a file name of the data destination, the controller 12 sendsa data transfer request instruction to the data transmitting apparatus1, and simultaneously outputs an address corresponding to the enteredfile name of the data source and a read enable signal to the memory 11.

The memory 11 sends data from a corresponding file in the data sourcethrough the data bus 13 to the data transmitting apparatus 1. Asdescribed in detail later on, the data transmitting apparatus 1 eithercompresses the transferred data or does not compress the transferreddata, and retransmits the data to the memory 11. Prior to theretransmission of the data, the data transmitting apparatus 1 outputs atransfer request signal to the controller 12. In response to thetransfer request signal from the data transmitting apparatus 1, thecontroller 12 outputs an address corresponding to the entered file nameof the data destination and a write enable signal to the memory 11.

The compressed data or the data which is not compressed (hereinafterreferred to as the "uncompressed data") which is outputted from the datatransmitting apparatus 1 is supplied through the data bus 13 to thememory 11, where the data is written in a corresponding file in the datadestination.

In the example shown in FIG. 3, data is transmitted, i.e., data is readand written, between a number of files that are logically developed inone 21 of two memories 21, 22 and a number of files that are logicallydeveloped in the other 22 of the two memories 21, 22 through the datatransmitting apparatus 1 under the control of a controller 12.

In this mode of use, specifically, the memories 21, 22 and the datatransmitting apparatus 1 are connected to each other through data buses23, 24, the controller 12 and the data transmitting apparatus 1 areconnected to each other through a control bus 14 and a data bus 15, thememories 21, 22 and the controller 12 are connected to each otherthrough memory control buses 25, 26 and address buses 27, 28, and thecontroller 12 and a key input means 18 are connected to each otherthrough an interface bus 19.

When the key input means 18 is operated to enter the device number and afile name of the memory 21 which is the data source and the devicenumber and a file name of the memory 22 which is the data destination,the controller 12 sends a data transfer request instruction to the datatransmitting apparatus 1, and simultaneously outputs an addresscorresponding to the entered file name of the data source and a readenable signal to the memory 21 which corresponds to the entered devicenumber of the data source, through the address bus 27 and the controlbus 25, respectively.

The memory 21 sends data from a corresponding file in the data sourcethrough the data bus 23 to the data transmitting apparatus 1. The datatransmitting apparatus 1 either compresses the transferred data or doesnot compress the transferred data, and transmits the data to the memory22 which is the data destination. Prior to the transmission of the datato the memory 22, the data transmitting apparatus 1 outputs a transferrequest signal to the controller 12. In response to the transfer requestsignal from the data transmitting apparatus 1, the controller 12 outputsan address corresponding to the entered file name of the datadestination and a write enable signal to the memory 22 which correspondsto the entered device number of the data destination, through theaddress bus 28 and the control bus 26, respectively.

The compressed data or the uncompressed data which is outputted from thedata transmitting apparatus 1 is supplied through the data bus 24 to thememory 22, where the data is written in a corresponding file in the datadestination.

In the example shown in FIG. 4, a data transmitting apparatus 1 isinserted and connected as a relay apparatus between two communicationdevices (including computer peripherals) 31, 32, and data is transmittedbetween the communication devices 31, 32 through the data transmittingapparatus 1 under the control of a controller 12. The communicationdevices 31, 32 are capable of storing communication data supplied todata input/output terminals thereof respectively into memories 33, 34.

In this mode of use, specifically, the communication devices 31, 32 andthe data transmitting apparatus 1 are connected to each other throughrespective data communication paths (including a communication network)35, the controller 12 and the data transmitting apparatus 1 areconnected to each other through a control bus 14 and a data bus 15, thecommunication devices 31, 32 and the controller 12 are connected to eachother through respective control cables 36, 37, and the controller 12and a key input means 18 such as a keyboard or the like are connected toeach other through an interface bus 19.

When the key input means 18 is operated to enter the device number ofthe communication device 31 as the data source and the device number ofthe communication device 32 as the data destination, the controller 12sends a data transfer request instruction to the data transmittingapparatus 1, and simultaneously outputs a data output request signal tothe communication device 31 corresponding to the entered device numberof the data source through the control cable 36.

The memory 33 combined with the communication device 31 as the datasource sends communication data through the data communication path 35to the data transmitting apparatus 1. The data transmitting apparatus 1either compresses the transferred data or does not compress thetransferred data, and transmits the data to the communication device 32as the data destination through the data communication path 35. Prior tothe transmission of the data to the communication device 32, the datatransmitting apparatus 1 outputs a transfer request signal to thecontroller 12. In response to the transfer request signal from the datatransmitting apparatus 1, the controller 12 outputs a data storagerequest signal to the communication device 32 which corresponds to theentered device number of the data destination through the control cable37.

The compressed data or the uncompressed data which is outputted from thedata transmitting apparatus 1 is supplied through the data communicationpath 35 to the communication device 32 as the data destination, wherethe data is written in the memory 34 combined therewith.

In the example shown in FIG. 5, a data transmitting apparatus 1 isinserted and connected between two processors 41, 42 on one printedcircuit board, and data is transmitted between the processors 41, 42through the data transmitting apparatus 1 under the control of acontroller 12. The processors 41, 42 are capable of storing processingdata supplied to data input/output terminals thereof respectively intomemories 43, 44.

In this mode of use, specifically, the processors 41, 42 and the datatransmitting apparatus 1 are connected to each other through respectivedata buses 45, 46, the controller 12 and the data transmitting apparatus1 are connected to each other through a control bus 14 and a data bus15, the processors 41, 42 and the controller 12 are connected to eachother through respective control buses 47, 48, and the controller 12 anda key input means 18 such as a keyboard or the like are connected toeach other through an interface bus 19.

When the key input means 18 is operated to enter the device number ofthe processor 41 as the data source and the device number of theprocessor 42 as the data destination, the controller 12 sends a datatransfer request instruction to the data transmitting apparatus 1, andsimultaneously outputs a data output request signal to the processor 41corresponding to the entered device number of the data source throughthe control bus 47.

The memory 43 connected to the processor 41 as the data source through abus 49 sends data through the data bus 45 the data transmittingapparatus 1. The data transmitting apparatus 1 either compresses thetransferred data or does not compress the transferred data, andtransmits the data to the processor 42 as the data destination throughthe data bus 46. Prior to the transmission of the data to the processor42, the data transmitting apparatus 1 outputs a transfer request signalto the controller 12. In response to the transfer request signal fromthe data transmitting apparatus 1, the controller 12 outputs a datastorage request signal to the processor 42 which corresponds to theentered device number of the data destination through the control bus48.

The compressed data or the uncompressed data which is outputted from thedata transmitting apparatus 1 is supplied through the data bus 46 to theprocessor 42 as the data destination, where the data is written in thememory 44 connected to the processor 42 through a bus 50.

In the example shown in FIG. 6, a data transmitting apparatus 1 is usedto transmit data between a host computer 51 and an external memorydevice 52, for example. The data transmitting apparatus 1 isincorporated as a data processing apparatus in the host computer 51.

In this mode of use, specifically, a CPU 53 in the host computer 51 andthe data transmitting apparatus 1 are connected to each other through adata bus, a control bus, and an input/output port 54, and the datatransmitting apparatus 1 and the external memory device 52 are connectedto each other through an interface bus 55.

When a key input means 18 connected to the host computer 51 is operatedto enter the file name of a file (a text file, an execution file, or thelike) developed in a data RAM 56 in the host computer 51 which serves asthe data source, and also the device number of the external memorydevice 52 which serves as the data destination, the CPU 53 sends a datatransfer request signal to the data transmitting apparatus 1, andsimultaneously outputs an address corresponding to the entered file nameand a read enable signal to the data RAM 56 through an address bus andthe control bus, respectively.

The data RAM 56 sends data from the file therein to the datatransmitting apparatus 1 through the data bus and the input/output port54. The data transmitting apparatus 1 either compresses the transferreddata or does not compress the transferred data, and transmits the datato the external memory device 52 corresponding to the entered devicenumber of the data destination through the interface bus 55. Prior tothe transmission of the data to the external memory device 52, the datatransmitting apparatus 1 outputs a transfer request signal to the CPU 53in the host computer 51. In response to the transfer request signal fromthe data transmitting apparatus 1, the host computer 51 outputs a datastorage request signal to the external memory device 52 whichcorresponds to the entered device number of the data destination throughthe interface bus 55.

The compressed data or the uncompressed data which is outputted from thedata transmitting apparatus 1 is supplied through the interface bus 55to the external memory device 52 as the data destination, where the datais written in a storage medium, such as an optical disk, a magneticdisk, a semiconductor memory, or the like, incorporated in the externalmemory device 52.

In the example shown in FIG. 7, a data transmitting apparatus 1 is usedto transmit data between a host computer 51 and an external memorydevice 52, for example. The data transmitting apparatus 1 isincorporated as a data processing apparatus in the external memorydevice 52. Specific structure and operation of this example will bedescribed in detail later on.

Specific structure and processing operation of the data transmittingapparatus 1 incorporated in the examples shown in FIGS. 2 through 7 willbe described below with reference to FIGS. 8 through 18. In FIGS. 8through 18, the files in the memory 11 shown in FIG. 2, the memories 21,22 shown in FIG. 3, the communication devices 31, 32 shown in FIG. 4,the processors 41, 42 shown in FIG. 5, and the host computer 51 and theexternal memory device 52 shown in FIG. 6 are referred to as the datasource 2 and the data destination 3 as shown in FIG. 1.

As shown in FIG. 8, the data processing apparatus 1 comprises, as itshardware components, a program ROM 61 storing various programs, a dataROM 62 registering various fixed data, a working RAM 63 used to executea program read from the program ROM 61, a data RAM 64 for storing datafrom the data source 2, control signals from the controller 12, keyinput data (data from the key input means 18), and data processed byvarious programs, an input port 65 and an output port 66 for inputtingdata from and outputting data to external circuits, such as the datasource 2, the data destination 3, and the controller 12, a datacompression circuit 67 for compressing data stored in the data RAM 64and storing the compressed data in a given area in the data RAM 64, anda CPU (control and logic/arithmetic unit) 68 for controlling thesecircuits.

The data compression circuit 67 is a circuit for compressing supplieddata in a loss-less manner, i.e., producing loss-less compressed datausing a buffer memory 69, and may comprise a microcomputer or the like.While the loss-less data compression technique itself used by the datacompression circuit 67 has no direct bearing on the present inventionand hence will not be described in detail, it may be the LZW compressingtechnique. Briefly, the LZW compressing technique is a process whichutilizes a conversion table for converting an entered string ofcharacters (data), e.g., well known "RINTINTIN", into a code.

Specifically, an entered string of characters is read, and converted(encoded) into a code based on 26 alphabetical letters, for example,registered in a dictionary (hereinafter referred to as a "basicconversion table"), and a string of characters not registered in thebasic conversion table is registered by generating a new dictionary(hereinafter referred to as a "generated conversion table"). While thegenerated conversion table is updated and used, an entered string ofcharacters is compressed. For expanding a compressed string ofcharacters, i.e., decoding a compressed string of characters, agenerated conversion table is produced from the compressed string ofcharacters and the compressed string of characters is expanded.

The various circuits transfer data through a data bus DB extending fromthe CPU 68, and are controlled by the CPU 68 through a control bus (notshown) extending from the CPU 68.

Key input data and control signals from the controller 12, and outputdata from the data source 2 are supplied through the input port 65 tothe data bus DB.

Data (compressed data or uncompressed data) stored in the data RAM 64and destined for the data destination 3 is supplied through the outputport 66 to the data destination 3. Request signals or the like stored inthe data RAM 64 and destined for the controller 12 are supplied throughthe output port 66 to the controller 12.

When data transferred from the data source 2 is compressed by the datacompression circuit 67, the data transmitting apparatus 1 transfers thecompressed data to the data destination 3 if the compression ratio orthe difference between the data length of the data prior to beingcompressed (hereinafter referred to as "pre-compression data" which hasthe same meaning as the uncompressed data described above) and the datalength of the data after being compressed (hereinafter referred to as"compressed data") is equal to or greater than a predetermined value,and transfers the pre-compression data to the data destination 3 if thecompression ratio or the data length difference is smaller than thepredetermined value.

For example, for storing data in an external memory device which effectsrandom access to an optical disk, a magnetic disk, or the like thatstores data in blocks each having a fixed length of 512 bytes, when 1Kbytes of uncompressed data are supplied to the data transmittingapparatus 1, a space on the disk can be saved if the difference betweenthe data length of the uncompressed data and the data length of thecompressed data is 512 bytes or more.

In such a case, therefore, the difference between the data length of theuncompressed data and the data length of the compressed data isdetermined, and it is determined whether the difference (actualdifference) is equal to or greater than a preset value, e.g., 512 bytes.If the actual difference is equal to or greater than 512 bytes, then thecompressed data is outputted to the external memory device, and if theactual difference is smaller than 512 bytes, then the uncompressed datais outputted to the external memory device.

For shortening the time required for data transfer between the hostcomputer 51 and the external memory device 52, for example, the ratio(actual compression ratio) of the data length of the uncompressed datato the data length of the compressed data is determined. That is, sincethe time required for data compression/expansion is not constant, butvaries depending on the size of the data, the actual difference betweenthe uncompressed data and the compressed data is not used, but theactual compression ratio is used to determine whether the compresseddata or the uncompressed data is to be outputted for shortening the timerequired for data transfer.

It is determined whether the determined actual compression ratio is atleast a theoretically or experimentally determined compression ratio(preset compression ratio) or not. If the actual compression ratio isequal to or greater than the preset compression ratio, then thecompressed data is outputted to the external memory device 52, and ifthe actual compression ratio is smaller than the preset compressionratio, then the uncompressed data is outputted to the external memorydevice 52.

Specific values of the preset difference and the preset compressionratio used to determine which of the uncompressed data and thecompressed data is to be processed, i.e., to be outputted to theexternal memory device in the above example, differ depending on asystem using such data compression. Since the time required for datacompression/expansion differs depending on the hardware or the software,specific values of the preset difference and the preset compressionratio also differ depending on the hardware or the software.

In the data transmitting apparatus 1, specific values of the presetdifference and the preset compression ratio are predetermined accordingto its specifications. If the specific values of the preset differenceand the preset compression ratio are to be changed subsequently, thenthe operator (user) can change the values using the key input means 18connected to the controller 12.

Two examples of processing operation of the data transmitting apparatus1 will be described below with reference to function block diagrams andflowcharts shown in FIGS. 9 through 18.

Description of a data transmitting apparatus according to a firstembodiment!

First, a data transmitting apparatus for carrying out an example ofprocessing operation (hereinafter referred to as a data transmittingapparatus according to a first embodiment) will be described below withreference to FIGS. 9 through 11.

As shown in FIG. 10, at the same time that the power supply is switchedon, the data transmitting apparatus 1 according to the first embodimentis initialized, e.g., its system check, memory check, and set-up processare carried out in a step S1.

Then, in a step S2, a data processing means 71 (data processing program:a means, see FIG. 9, for outputting data, either compressed oruncompressed, from the data source 2 to the data destination 3) is readfrom the program ROM 61 and written into the working RAM 63. At the sametime, a working area for temporarily storing data generated during theexecution of the program 71 and for transferring parameters betweenroutines is allotted to the working RAM 63.

To the data RAM 64, there are allotted a pre-compression data storagearea for storing pre-compression data from the data source 2, acompressed data storage area for storing compressed data from the datacompression circuit 67, and a fixed data storage area for storingvarious fixed data from the data ROM 62.

The fixed data storage area has a difference storage area for storingthe difference (preset difference α) preset according to thespecifications and a compression ratio storage area for storing thecompression ratio (preset compression ratio β) preset according to thespecifications. Values of the preset difference α and the presetcompression ratio β which are predetermined according to thespecifications may be 512 bytes and 4/3, respectively, for example.

In the step S2, the program is transferred as described above, and alsovarious fixed data are read from the data ROM 62 and stored in the fixeddata storage area. At this time, the preset difference α and the presetcompression ratio β which are registered in the data ROM 62 are storedrespectively into the difference storage area and the compression ratiostorage area. Since the preset difference α is of a value (naturalnumber) represented by bytes, it is stored as fixed-point data. Sincethe preset compression ratio β is of a real number value, it is storedas floating-point data, for example.

As shown in FIG. 9, the data processing program 71 that is read into theworking RAM 63 comprises a decision means 72 for making variousdecisions, a key input data receiving means 73 for receiving key inputdata supplied from the controller 12 through the input port 65 andstoring the key input data into a given storage area of the data RAM 64,a pre-compression data receiving means 74 for receiving pre-compressiondata supplied from the data source 2 through the input port 65 andstoring the pre-compression data into a pre-compression data storagearea of the data RAM 64, a compressed data storing means 75 forreceiving compressed data supplied from the data compression circuit 67and storing the compressed data into a compressed data storage area ofthe data RAM 64, a difference/compression ratio calculating means 76 forcalculating an actual difference and an actual compression ratio basedon the data length of the pre-compression data and the data length ofthe compressed data, a transfer request signal output means 77 foroutputting a transfer request signal to the controller 12 through theoutput port 66, a transfer request data generating means 78 forgenerating transfer request data to transfer the pre-compression data orthe compressed data to the data destination 3, a transfer request dataoutput means 79 for outputting the generated transfer request data tothe data destination 3 through the output port 66, and a message outputmeans 80 for outputting an information code relative to a message to thecontroller 12.

According to the data processing program 71, the decision means 72determines whether there is a transfer request from the controller 12 ornot in a step S3 shown in FIG. 10, based on whether there is aninterrupt input based on a transfer request instruction from thecontroller 12. The step S3 is repeated until a transfer requestinstruction from the controller 12 is inputted, and hence waits for atransfer request.

If there is a transfer request, control proceeds to a step S4 in whichthe decision means 72 determines whether there is a key input or notbased on whether there is an information signal indicative of a keyinterrupt input from the controller 12.

The information signal is outputted from the controller 12 based on akey interrupt input which is produced when the operator operates the keyinput means 18 such as a keyboard or the like. Specifically, theoperator operates the key input means 18 to enter a fine name, a devicenumber, and values of the difference and the compression ratio whileviewing a non-illustrated display monitor such as a CRT, a liquiddisplay, or the like which is connected to the controller 12, whereuponthe information signal is outputted from the controller 12.

If there is a key input, control goes to a next step S5 in which the keyinput data receiving means 73 receives key input data sent from thecontroller 12 through the input port 65, and stores the received keyinput data into the fixed data storage area of the data RAM 64.Specifically, since the key input data is relative to a difference or acompression ratio entered through the key input means 18 by theoperator, if the key input data is relative to a difference, then thekey input data is stored in the difference storage area of the fixeddata storage area, and if the key input data is relative to acompression ratio, then the key input data is stored in the compressionratio storage area of the fixed data storage area.

Therefore, the preset difference α and the preset compression ratio βwhich have been read from the data ROM 62 in the step S2 are replacedwith the preset difference α and the preset compression ratio β whichare entered through the key input means 18.

In a next step S6, the pre-compression data receiving means 74 receivesthe pre-compression data from the data source 2 through the input port65, and stores the received pre-compression data into thepre-compression data storage area of the data RAM 64. For transmittingdata, it is customary to add a header containing information whichrepresents the type of the data, the data length, etc. to the beginningof the data. In the step S6, the pre-compression data receiving means 74stores the pre-compression data, and also stores data relative to thedata length of the pre-compression data contained in the header into afirst register R1, which is a register declared a first working registerR1 among various registers used in the data processing program 71.

In a next step S7, the pre-compression data stored in thepre-compression data storage area of the data RAM 64 is outputted to thedata compression circuit 67. The data compression circuit 67 effects aloss-less data compression process on the supplied pre-compression datausing the buffer memory 69 in a step S8.

In a next step S9, the compressed data storing means 75 reads thecompressed data outputted from the data compression circuit 67, andstores the compressed data in the compressed data storage area of thedata RAM 64. At this time, the number of bytes, for example, from thestart of the compressed data to the end of the compressed data iscounted, and the counted number is stored as the data length of thecompressed data in a second register R2, which is a register declared asecond working register R2 among various registers used in the dataprocessing program 71.

In a next step S10, the difference/compression ratio calculating means76 calculates an actual difference and an actual compression ratio basedon the data length of the pre-compression data and the data length ofthe compressed data. Specifically, the actual difference is calculatedby subtracting the data length of the compressed data stored in thesecond register R2 from the data length of the pre-compression datastored in the first register R1. The produced difference is stored asthe actual difference in a third register R3, which is a registerdeclared a third working register R3 among various registers used in thedata processing program 71. The actual compression ratio is calculatedby dividing the data length of the compressed data stored in the secondregister R2 by the data length of the pre-compression data stored in thefirst register R1. The quotient, e.g., floating-point data, is stored asthe actual difference in a fourth register R4, which is a registerdeclared a fourth working register R4 among various registers used inthe data processing program 71.

Then, in a step S11 shown in FIG. 11, the decision means 72 determineswhether the actual difference is at least the preset difference α basedon the actual difference stored in the third register R3 and the presetdifference α stored in the difference storage area.

If the actual difference is at least the preset difference α, i.e., isequal to or greater than the preset difference α, then control proceedsto a step S12 in which the decision means 72 determines whether theactual compression ratio is at least the preset compression ratio βbased on the actual compression ratio stored in the fourth register R4and the preset compression ratio β stored in the compression ratiostorage area.

If the actual compression ratio is at least the preset compression ratioβ, i.e., is equal to or greater than the preset compression ratio β,then control goes to a step S13 in which the transfer request datagenerating means 78 generates transfer request data for the compresseddata. Specifically, the transfer request data is generated in a givenarray variable area (transfer request data area) in a program workingarea allotted to the data RAM 64, and is composed of a header sectionand a data section. The transfer request data generating means 78generates transfer request data for the compressed data by registeringan identification code indicative of the compressed data and the datalength of the compressed data stored in the second register R2 in theheader section, and adding the compressed data as the data section.

Thereafter, the message output means 80 outputs an information codeindicating that the data has been compressed, which may be theidentification code indicative of the compressed data, through theoutput port 66 to the controller 12 in a step S14. In response to theinformation code supplied from the data transmitting apparatus 1, thecontroller 12 outputs message data indicating that the data has beencompressed to the display monitor. The display monitor now displays amessage "DATA HAS BEEN COMPRESSED", for example, on its screen.

If the actual difference is smaller than the preset difference α in thestep S11 or if the actual compression ratio is smaller than the presetcompression ratio β in the step S12, then control goes to a step S15 inwhich the transfer request data generating means 78 generates transferrequest data for the pre-compression data. Specifically, the transferrequest data is generated in the transfer request data area allotted tothe data RAM 64. The transfer request data generating means 78 generatestransfer request data for the pre-compression data by registering anidentification code indicative of the pre-compression data and the datalength of the pre-compression data stored in the first register R1 inthe header section, and adding the pre-compression data as the datasection.

Thereafter, the message output means 80 outputs an information codeindicating that the data has not been compressed, which may be theidentification code indicative of the pre-compression data, through theoutput port 66 to the controller 12 in a step S16. In response to theinformation code supplied from the data transmitting apparatus 1, thecontroller 12 outputs message data indicating that the data has not beencompressed to the display monitor. The display monitor now displays amessage "DATA HAS NOT BEEN COMPRESSED", for example, on its screen.

After the step S14 or S16, control goes to a step S17 in which thetransfer request signal output means 77 outputs a transfer requestsignal through the output port 66 to the controller 12. The controller12 outputs a control signal such as a write enable signal, a datastorage request signal, or the like for receiving data transferred fromthe data transmitting apparatus 1, to the data destination 3. The datadestination 3 is now brought into a mode for waiting for data from thedata transmitting apparatus 1.

In a next step S17, the transfer request data output means 79 outputsthe transfer request data for the compressed data or the pre-compressiondata stored in the transfer request data area of the data RAM 64,through the output port 66 to the data destination 3.

If the data is outputted to the data destination 3 through atransmission path such as a data communication path which tends tosuffer a transmission error, then the transfer request data output means79 adds an error- correcting code to the transfer request data, andoutputs the transfer request data with the added error-correcting code.

In a next step S19, the decision means 72 determines whether there is aprogram finishing request or not based on whether there is a finishingrequest interrupt input such as a power supply turn-off input.

If there is no program finishing request in the step S19, then controlreturns to the step S3 to wait for a next transfer request from the datasource 2. If there is a program finishing request in the step S19, thenthe data processing program 71 comes to an end.

In the data transmitting apparatus 1 according to the first embodiment,it is determined whether the compressed data or the pre-compression datais to be transferred to the data destination 3 based on the comparisonbetween the actual difference and the preset difference α and thecomparison between the actual compression ratio and the presetcompression ratio β. Based on the decision, the compressed data or thepre-compression data is transferred to the data destination 3.Therefore, it is possible to prevent a phenomenon in which the size ofcompressed data which occupies a storage area in the data destination 3is substantially the same as the size of uncompressed data whichoccupies the storage area, and also to avoid wasteful data expansion inthe data destination 3.

Since the preset difference α and the preset compression ratio β canfreely be changed by a key input, it is possible to change the presetdifference α and the preset compression ratio β which have been set forshipment into a preset difference α and a preset compression ratio βthat have been logically or experimentally established on a system(hardware and software) created by the operator (user). As aconsequence, data can be compressed under data compressing conditionsoptimum for the system created by the operator (user), making itpossible to improve the quality of file management. This leads to anincrease in the overall system performance.

Inasmuch as a message indicative of whether the data has been compressedor not is displayed on the display monitor screen in the step S14 orS16, the user can confirm, at a glance, whether the requested data(file) has actually been compressed or not, resulting in improved systemusability.

The decision routine by way of ANDing is employed in the steps S11, S12which allow compressed data to be transmitted only when the actualdifference is at least the preset difference α and the actualcompression ratio is at least the preset compression ratio β. Thisdecision routine offers advantages over the following practice:

It is assumed that a routine is employed to transfer compressed data tothe data destination 3 when the actual difference is at least the presetdifference α. With the preset difference a being 512 bytes, for example,if the pre-compression data supplied from the data source 2 has a datalength of 2 Kbytes, then compressed data is transferred to the datadestination 3 when the data length of the compressed data is 1.5 Kbytesor shorter.

Similarly, if the pre-compression data supplied from the data source 2has a data length of 1 Mbytes (1000 Kbytes), then compressed data istransferred to the data destination 3 when the data length of thecompressed data is 999.5 Kbytes or shorter.

The ratio (actual compression ratio) of the pre-compression data (datalength=1000 Kbytes) to the compressed data (data length=999.5 Kbytes) isabout 1.0005, and the percentage of the data length (corresponding tothe data length difference) removed by the data compression with respectto the data length of the pre-compression data is only 0.05%. With thiscompression ratio, the data length of the compressed data remainssubstantially the same as the data length of the pre-compression data.

Consequently, when it is determined whether the compressed data or thepre-compression data is to be transferred to the data destination 3based on only the comparison between the actual difference and thepreset difference α, if the actual difference is equal to or greaterthan the preset difference α, then the compressed data is transferred tothe data destination 3 even though the percentage of the data length(corresponding to the data length difference) removed by the datacompression with respect to the data length of the pre-compression datais only 0.05%, for example, and the data length of the compressed dataremains substantially the same as the data length of the pre-compressiondata. As a consequence, the compressed data needs to be expanded in thedata destination 3 over a period of time which is not short, resultingin a wasteful expenditure of time in the data destination 3.

In the data transmitting apparatus 1 according to the first embodiment,compressed data is transferred to the data destination 3 only when theactual difference is at least the preset difference α and the actualcompression ratio is at least the preset compression ratio β, asdescribed above. Thus, even when the actual difference is at least thepreset difference a, no compressed data is transferred, but thepre-compression data is transferred, if the actual compression ratio issmaller than the preset compression ratio β. In this case, notime-consuming data expansion process is carried out in the datadestination 3, so that any wasteful expenditure of time occurs in thedata destination 3. In this manner, the overall system performance isimproved.

Description of a data transmitting apparatus according to a secondembodiment!

First, a data transmitting apparatus for carrying out another example ofprocessing operation (hereinafter referred to as a data transmittingapparatus according to a second embodiment) will be described below withreference to FIGS. 12 through 18.

As shown in FIG. 13, at the same time that the power supply is switchedon, the data transmitting apparatus 1 according to the second embodimentis initialized, e.g., its system check, memory check, and set-up processare carried out in a step S101.

Then, in a step S102, a data processing means 91 (data processingprogram: a means, see FIG. 12, for outputting data, either compressed oruncompressed, from the data source 2 to the data destination 3) is readfrom the program ROM 61 and written into the working RAM 63. At the sametime, a working area for temporarily storing data generated during theexecution of the program 91 and for transferring parameters betweenroutines is allotted to the working RAM 63.

To the data RAM 64, there are allotted a pre-compression data storagearea for storing pre-compression data from the data source 2, acompressed data storage area for storing compressed data from the datacompression circuit 67, and a fixed data storage area for storingvarious fixed data from the data ROM 62.

The fixed data storage area has a compression ratio storage area forstoring the compression ratio (preset compression ratio β) presetaccording to the specifications, a pre-compression data readout sizestorage area for storing the data length (a pre-compression data readoutsize A) of pre-compression data to be compressed in one cycle, and aprescribed loop number storage area for storing the number B ofprocessing loops (hereinafter referred to as "prescribed loop number B")necessary to determine a predicted compression ratio.

The pre-compression data readout size A is predetermined according tospecifications, and is allotted, for example, a unit length (2 Kbytes inthis example) of write-protect data for the data RAM 64. Thewrite-protect data for the data RAM 64 is set to units of 2 Kbytes, forexample, by a data management program of the operating system (OS) atthe time data which is inhibited from being overwritten, correspondingto pre-compression data in this example, is stored in a certain storagearea of the data RAM 64. Any data is inhibited from being written in thestorage area in which the write-protect data has been stored.

In response to a data deletion request from the data processing program91 to the OS, the write-protect data is deleted in units of 2 Kbytesfrom the storage area, allowing data to be written in the storage area.Therefore, another program or the like may utilize the storage area fromwhich the write-protect data has been deleted as a working area or adata storage area.

In the data transmitting apparatus 1 according to the second embodiment,before all pre-compression data is compressed, 10 Kbytes ofpre-compression data, for example, are compressed, and an actualcompression ratio (hereinafter referred to as a "predicted compressionratio") obtained by the compression of the 10 Kbytes of pre-compressiondata is regarded as an actual compression ratio for all pre-compressiondata. Then, it is determined whether compressed data or pre-compressiondata is to be transferred or not based on the predicted compressionratio.

Referring back to the main routine shown in FIG. 13, various fixed dataare read from the data ROM 62 and stored in the fixed data storage area.At this time, the preset compression ratio β which is registered in thedata ROM 62 is stored into the compression ratio storage area. Since thepreset compression ratio β is of a real number value, it is stored asfloating-point data, for example.

The pre-compression data readout size A and the prescribed loop number Bregistered in the data ROM 62 are stored respectively into thepre-compression data readout size storage area and the prescribed loopnumber storage area.

As shown in FIG. 12, the data processing program 91 that is read intothe working RAM 63 comprises a decision means 92 for making variousdecisions, a key input data receiving means 93 for reading key inputdata supplied from the controller 12 through the input port 65 andstoring the key input data into a given storage area of the data RAM 64,a pre-compression data receiving means 94 for receiving pre-compressiondata supplied from the data source 2 through the input port 65 andstoring the pre-compression data into a pre-compression data storagearea of the data RAM 64, a predicted compression ratio calculating means95 for compressing a portion of the pre-compression data, e.g., 10Kbytes of the pre-compression data, to determine a predicted compressionratio, data compressing means 96 for compressing all the pre-compressiondata if the predicted compression ratio satisfies a given condition, anddeleting the pre-compression data, a transfer request signal outputmeans 97 for outputting a transfer request signal to the controller 12through the output port 66, a transfer request data generating means 98for generating transfer request data to controller 12, whereupon theinformation signal is outputted from the controller 12.

If there is a key input, control goes to a next step S105 in which thekey input data receiving means 93 reads key input data sent from thecontroller 12 through the input port 65, and stores the received keyinput data into the fixed data storage area of the data RAM 64.Specifically, since the key input data is relative to a compressionratio entered through the key input means 18 by the operator, the keyinput data is stored into the compression ratio storage area of thefixed data storage area.

Therefore, the preset compression ratio β which has been read from thedata ROM 62 in the step S102 is replaced with the preset compressionratio β which is entered through the key input means 18.

In a next step S106, the pre-compression data receiving means 94 readsthe pre-compression data from the data source 2 through the input port65, and stores the received pre-compression data into thepre-compression data storage area of the data RAM 64. For transmittingdata, it is customary to add a header containing information whichrepresents the type of the data, the data length, etc. to the beginningof the data. In the step S106, the pre-compression data receiving means94 stores the pre-compression data, and also stores data relative to thedata length of the pre-compression data contained in the header into afirst register R1. Inasmuch as the read pretransfer the pre-compressiondata or the compressed data to the data destination 3, a transferrequest data output means 99 for outputting the generated transferrequest data to the data destination 3 through the output port 66, and amessage output means 100 for outputting an information code relative toa message to the controller 12.

According to the data processing program 91, the decision means 92determines whether there is a transfer request from the controller 12 ornot in a step S103 shown in FIG. 13, based on whether there is aninterrupt input based on a transfer request instruction from thecontroller 12. The step S103 is repeated until a transfer requestinstruction from the controller 12 is inputted, and hence waits for atransfer request.

If there is a transfer request, control proceeds to a step S104 in whichthe decision means 92 determines whether there is a key input or notbased on whether there is an information signal indicative of a keyinterrupt input from the controller 12.

The information signal is outputted from the controller 12 based on akey interrupt input which is produced when the operator operates the keyinput means 18 such as a keyboard or the like. Specifically, theoperator operates the key input means 18 to enter a fine name, a devicenumber, and values of the difference and the compression ratio whileviewing a non-illustrated display monitor such as a CRT, a liquiddisplay, or the like which is connected to the compression data is datainhibited from being overwritten, the data management program of the OSsets write-protect data in the pre-compression data storage area forinhibiting data from being written in the pre-compression data storagearea.

In a next step S107, the predicted compression ratio calculating means95 operates to calculate a predicted compression ratio, i.e., asubroutine for calculating a predicted compression ratio is initiated.

As shown in FIG. 15, the predicted compression ratio calculating means95 comprises a decision means 101 for determining the number ofprocessing routines, a pre-compression data reading means 102 forreading the pre-compression data from the pre-compression data storagearea by a data length indicated by the pre-compression data readout sizeA, a compressed data storing means 103 for reading compressed dataoutputted from the data compression circuit 67 and storing thecompressed data into the compressed data storage area of the data RAM64, a storage address calculating means 104 for calculating a storageaddress at which to store the compressed data in the compressed datastorage area, a compression ratio calculating means 105 for calculatingan actual compression ratio with respect to pre-compression data havinga data length (hereinafter referred to as "A bytes") indicated by thepre-compression data readout size A, and a predicted compression ratiocalculating means 106 for calculating a predicted compression ratio withrespect to all the pre-compression data based on the actual compressionratio calculated by the compression ratio calculating means 105.

As shown in FIG. 16, the predicted compression ratio calculating means95 initializes various parameters in a step S201. Specifically, thepredicted compression ratio calculating means 95 stores initial values"0" respectively into a register (hereinafter referred to as an "indexregister i") declared an index register i, a second register R2, a thirdregister R3, and a fourth register R4, among various registers used inthe data processing program 71.

In a next step S202, the pre-compression data reading means 102 reads Abytes of pre-compression data at the (i×A)th byte, which is determinedby multiplying the value of the index register i by the A bytes, fromthe start of the pre-compression data storage area. In a first loop, Abytes, e.g., 2 Kbytes, of pre-compression data from the 0th byte of thepre-compression data storage area are read.

In a next step S203, the read A bytes of pre-compression data areoutputted to the data compression circuit 67. The data compressioncircuit 67 compresses the A bytes of pre-compression data according tothe loss-less data compression process using the buffer memory 69 in astep S204. Unlike the data transmitting apparatus 1 according to thefirst embodiment, it is not necessary to compress all thepre-compression data, but it is only necessary to compress the A bytes,e.g., 2 Kbytes, of pre-compression data. Therefore, the size of thebuffer memory 69 may be reduced.

In a next step S205, the compressed data storing means 103 reads thecompressed data outputted from the data compression circuit 67 andstores the compressed data into the compressed data storage area of thedata RAM 64 at the Nth byte (address), where N is an integer,corresponding to the value of the third register R3. Since the value ofthe third register R3 is "0" in the first routine, the compressed datais stored into the compressed data storage area from the 0th byte(starting address). At this time, the number of bytes, for example, fromthe start of the compressed data to the end of the compressed data iscounted, and the counted number is stored as the data length of thecompressed data in the second register R2.

In a next step S206, the storage address calculating means 104calculates an address at which to store next compressed data in thecompressed data storage area. Specifically, the storage addresscalculating means 104 calculates this address by adding the value (thepresent storage address) of the third register R3 and the value (thepresent data length of the compressed data) of the second register R2,and stores the sum into the third register R3.

In a next step S207, the compression ratio calculating means 105determines an actual compression ratio with respect to the present 2Kbytes of pre-compression data, and determines an accumulation of thedetermined actual compression ratio and the previous compression ratio.This calculation is carried out by dividing the A bytes by the value ofthe second register R2, adding the quotient (floating-point data) andthe value (the previous compression ratio) of the fourth register R4,and storing the sum again into the fourth register R4.

In a next step S208, the value of the index register i is incremented by+1.

In a next step S209, the decision means 101 determines whether thenumber of processing loops has reached the prescribed loop number Bnecessary to determine a predicted compression ratio by determiningwhether the value of the index register i reached the prescribed loopnumber B that is stored in the prescribed loop number storage area.

If the number of processing loops has not reached the prescribed loopnumber B, then control returns to the step S202 and the step S202 andfollowing steps are executed. If the A bytes are 2 Kbytes and the datalength of pre-compression data necessary to determine a predictedcompression ratio is 10 Kbytes, then the prescribed loop number B is 5.The prescribed loop number B is determined according to specifications.

If the number of processing loops (the value of the index register i)has reached the prescribed loop number B, then control proceeds to astep S210 in which the predicted compression ratio calculating means 106determines a present predicted compression ratio by dividing theaccumulated value of as many actual compression ratios as the number ofprocessing loops stored in the fourth register R4 by the prescribed loopnumber B, and storing the quotient into the fourth register R4.

The pre-compression data transferred from the data source 2 may comprisedata having different attributes including text data, bit map data, andan execution file. If all the pre-compression data is text data, forexample, then a predicted compression ratio obtained by dividing theaccumulated value of actual compression ratios by the prescribed loopnumber B suffers only a small error with respect to an actualcompression ratio obtained by actually compressing all thepre-compression data.

If, however, the pre-compression data transferred from the data source 2comprises data having different attributes including bit map data and anexecution file in addition to text data, then an expected finalcompression ratio would tend to suffer a large error if the samecalculations as described above were carried out for these data.

According to the second embodiment, as many weighting coefficients C asthe number of types of data are employed by being registered in the dataROM 62. The type of data contained in the header of pre-compression datatransferred from the data source 2 is referred to, and the quotient ismultiplied by the weighting coefficient C corresponding to the type ofdata to produce a predicted compression ratio.

In this manner, irrespective of the type of data transferred from thedata source 2, any error of the predicted compression ratio with respectto the expected final compression ratio is minimized, thus improving theoverall system performance.

After the predicted compression ratio is calculated in the step S210,the operation of the predicted compression ratio calculating means 95(the predicted compression ratio calculating subroutine) is finished.

Referring back to FIG. 13, the decision means 92 determines whether thepredicted compression ratio is effective or not by determining whetherthe value (predicted compression ratio) of the fourth register R4 is atleast the preset compression ratio β stored in the preset compressionratio storage area in a step S108.

If the predicted compression ratio is at least the preset compressionratio β, i.e., is equal to or greater than the preset compression ratioβ, then control goes to a next step S109 in which the data compressingmeans 96 is operated, i.e., a data compressing subroutine is executed.

As shown in FIG. 17, the data compressing means 96 comprises a decisionmeans 111 for determining whether all pre-compression data has beencompressed, a pre-compression data reading means 112 for reading thepre-compression data from the pre-compression data storage area by Abytes, a compressed data storing means 113 for reading compressed dataoutputted from the data compression circuit 67 and storing thecompressed data into the compressed data storage area of the data RAM64, a storage address calculating means 114 for calculating a storageaddress at which to store the compressed data in the compressed datastorage area, and a compression ratio deleting means 115 for deleting arequested size of the pre-compression data stored in the pre-compressiondata storage area from a corresponding address.

As shown in FIG. 18, the data compressing means 96 (data compressingsubroutine) first corrects a reading pointer for pre-compression data ina step S301. Specifically, the reading pointer is corrected by storingthe prescribed loop number B into the index register i.

In a next step S302, the compression ratio deleting means 115 deletespre-compression data which has already been compressed by the predictedcompression ratio calculating means 95 from the pre-compression datastored in the pre-compression data storage area. The pre-compressiondata is deleted by outputting, to the OS, a deletion instruction havingparameters composed of a starting address of an area where thepre-compression data to be deleted is stored and the size of the data tobe deleted. In this case, the starting address is a starting address ofthe pre-compression data storage area in the data RAM 94, and thedeletion instruction has a value produced by multiplying the value ofthe index register i by the A bytes.

In response to the deletion instruction, the data management program ofthe OS is executed to delete the write-protect data from an areadetermined by the starting address and the size of the data to bedeleted, in the pre-compression data storage area. If 10 Kbytes ofpre-compression data are used to determine the predicted compressionratio, then the write-protect data is deleted from an area where theused 10 Kbytes of pre-compression data are stored. As a result, anotherprogram or the like may utilize the storage area of 10 Kbytes from whichthe write-protect data has been deleted as a working area or a datastorage area.

In a next step S303, the pre-compression data reading means 112 reads Abytes of pre-compression data at the (i×A)th byte, which is determinedby multiplying the value of the index register i by the A bytes, fromthe start of the pre-compression data storage area.

If 10 Kbytes of pre-compression data are used to determine a predictedcompression ratio, then since the value of the index register I is 5 andthe pre-compression data readout size A is 2 Kbytes, A bytes, e.g., 2Kbytes, of pre-compression data are read from the 10th byte of thepre-compression data storage area are read.

In a next step S304, the read A bytes of pre-compression data areoutputted to the data compression circuit 67. The data compressioncircuit 67 compresses the A bytes of pre-compression data according tothe loss-less data compression process using the buffer memory 69 in astep S305.

In a next step S306, the compressed data storing means 113 reads thecompressed data outputted from the data compression circuit 67 andstores the compressed data into the compressed data storage area of thedata RAM 64 at the Nth byte (address), where N is an integer,corresponding to the value of the third register R3. Since the value ofthe third register R3 is of a value corresponding to the size of thecompressed data used to determine the predicted compression ratio in thefirst loop, the compressed data is stored into the compressed datastorage area from a byte (starting address) next to the area occupied bythe compressed data stored when the predicted compression ratio wasdetermined. At this time, the number of bytes, for example, from thestart of the compressed data to the end of the compressed data iscounted, and the counted number is stored as the data length of thecompressed data in the second register R2.

In a next step S307, the storage address calculating means 114calculates an address at which to store next compressed data in thecompressed data storage area. Specifically, the storage addresscalculating means 114 calculates this address by adding the value (thepresent storage address) of the third register R3 and the value (thepresent data length of the compressed data) of the second register R2,and stores the sum into the third register R3.

In a next step S308, the compression ratio deleting means 115 deletesthe pre-compression data which has been read in the step S303 andcompressed in the step S305 from the pre-compression data stored in thepre-compression data storage area. Specifically, the compression ratiodeleting means 115 deletes the A bytes of pre-compression data at the(i×A)th byte, which is determined by multiplying the value of the indexregister i by the A bytes.

As with the step S302, the pre-compression data is deleted byoutputting, to the OS, a deletion instruction having parameters composedof a starting address (the (i×A)th byte of the pre-compression datastorage area) of an area where the pre-compression data to be deleted isstored and the size of the data (A bytes) to be deleted.

In response to the deletion instruction, the data management program ofthe OS is executed to delete the write-protect data from an areadetermined by the starting address (the (i×A)th byte) and the size ofthe data (A bytes) to be deleted, in the pre-compression data storagearea.

As a consequence, another program or the like may utilize the storagearea of A bytes from which the write-protect data has been deleted as aworking area or a data storage area.

In a next step S309, the value of the index register i is incremented by+1.

In a next step S310, the decision means 111 determines whether all thepre-compression data has been compressed by determining whether thevalue (the data length of the pre-compression data which has beencompressed) produced by multiplying the value of the index register i bythe A bytes is at least the data length of the all the pre-compressiondata stored in the first register R1.

If all the pre-compression data has not been compressed, then controlreturns to the step S303 and the step S303 and following steps areexecuted. If all the pre-compression data has been compressed, then theoperation of the data compressing means 96 is finished, i.e., the datacompressing subroutine is finished.

Referring back to the main routine shown in FIG. 13, the transferrequest data generating means 98 shown in FIG. 12 generates transferrequest data for the compressed data. Specifically, the transfer requestdata is generated in a given array variable area (transfer request dataarea) in a program working area allotted to the data RAM 64, and iscomposed of a header section and a data section. The transfer requestdata generating means 98 generates transfer request data for thecompressed data by registering an identification code indicative of thecompressed data and the data length of the compressed data stored in thesecond register R2 in the header section, and adding the compressed dataas the data section.

Thereafter, the message output means 100 outputs an information codeindicating that the data has been compressed, which may be theidentification code indicative of the compressed data, through theoutput port 66 to the controller 12 in a step S111. In response to theinformation code supplied from the data transmitting apparatus 1, thecontroller 12 outputs message data indicating that the data has beencompressed to the display monitor. The display monitor now displays amessage "DATA HAS BEEN COMPRESSED", for example, on its screen.

If the predicted compression ratio is smaller than the presetcompression ratio β in the step S108, then control goes to a step S112in which the transfer request data generating means 98 generatestransfer request data for the pre-compression data. Specifically, thetransfer request data is generated in the transfer request data areaallotted to the data RAM 64. The transfer request data generating means98 generates transfer request data for the pre-compression data byregistering an identification code indicative of the pre-compressiondata and the data length of the pre-compression data stored in the firstregister R1 in the header section, and adding the pre-compression dataas the data section.

Thereafter, the message output means 100 outputs an information codeindicating that the data has not been compressed, which may be theidentification code indicative of the pre-compression data, through theoutput port 66 to the controller 12 in a step S113. In response to theinformation code supplied from the data transmitting apparatus 1, thecontroller 12 outputs message data indicating that the data has not beencompressed to the display monitor. The display monitor now displays amessage "DATA HAS NOT BEEN COMPRESSED", for example, on its screen.

After the step S111 or S113, control goes to a step S114 shown in FIG.14 in which the transfer request signal output means 97 outputs atransfer request signal through the output port 66 to the controller 12.The controller 12 outputs a control signal such as a write enablesignal, a data storage request signal, or the like for receiving datatransferred from the data transmitting apparatus 1, to the datadestination 3. The data destination 3 is now brought into a mode forwaiting for data from the data transmitting apparatus 1.

In a next step S115, the transfer request data output means 99 outputsthe transfer request data for the compressed data or the pre-compressiondata stored in the transfer request data area of the data RAM 64,through the output port 66 to the data destination 3.

If the data is outputted to the data destination 3 through atransmission path such as a data communication path which tends tosuffer a transmission error, then the transfer request data output means99 adds an error- correcting code to the transfer request data, andoutputs the transfer request data with the added error-correcting code.

In a next step S116, the decision means 92 determines whether there is aprogram finishing request or not based on whether there is a finishingrequest interrupt input such as a power supply turn-off input.

If there is no program finishing request in the step S116, then controlreturns to the step S103 to wait for a next transfer request from thedata source 2. If there is a program finishing request in the step S116,then the data processing program 91 comes to an end.

In the data transmitting apparatus 1 according to the second embodiment,as with the data transmitting apparatus 1 according to the firstembodiment, it is determined whether the compressed data or thepre-compression data is to be transferred to the data destination 3based on the comparison between the actual compression ratio and thepreset compression ratio β. Based on the decision, the compressed dataor the pre-compression data is transferred to the data destination 3.Therefore, it is possible to prevent a phenomenon in which the size ofcompressed data which occupies a storage area in the data destination 3is substantially the same as the size of uncompressed data whichoccupies the storage area, and also to avoid wasteful data expansion inthe data destination 3.

Particularly, it is determined whether the compressed data or thepre-compression data is to be transferred to the data destination 3based on a predicted compression ratio that is determined not bycompressing all pre-compression data, but by compressing pre-compressiondata having a size, e.g., 10 Kbytes of pre-compression data, which isdetermined by the A bytes×the prescribed loop number B, and if it isfound that pre-compression data is to be transferred to the datadestination 3, any subsequent pre-compression data following thecompressed size of pre-compression data will not be compressed.Consequently, it is possible to shorten the entire processing time,i.e., the period of time from the stage of reading pre-compression datafrom the data source 2 to the transfer of the data to the datadestination 3.

Since the pre-compression data which has been compressed is successivelydeleted to delete write-protect data in the steps S302, S308 carried outby the data compressing means 96, the data RAM 64 can be used highlyefficiently and a system shutdown due to a storage capacity shortage canbe avoided.

Not all pre-compression data is transmitted to the data compressioncircuit 67, but pre-compression data is transmitted in units of A bytesto the data compression circuit 67 for data compression. Therefore, thebuffer memory 69 used by the data compression circuit 67 for datacompression may have a reduced storage capacity, with the result thatthe overall system circuit arrangement can reduced in size.

In the step S210 carried out by the predicted compression ratiocalculating means 95, weighting is effected depending on the type ofdata transferred from the data source 2 for determining a predictedcompression ratio. Accordingly, irrespective of the type of datatransferred from the data source 2, any error of the predictedcompression ratio with respect to the expected final compression ratiois minimized, thus improving the overall system performance.

The data transmitting apparatus 1 according to the first and secondembodiments are applicable to all systems for compressing data based onthe loss-less data compression technique.

Some systems compress data by files or blocks of fixed length dividedfrom files. The data transmitting apparatus 1 according to the first andsecond embodiments are also applicable to these systems.

Description of a data transmitting apparatus (data processing apparatus)according to a third embodiment!

A data transmitting apparatus according to a third embodiment, which isapplied to the mode of use shown in FIG. 7, will be described below withreference to FIGS. 19 through 42.

The data transmitting apparatus 1 according to the third embodiment isincorporated in the external memory device 52 connected to the hostcomputer 51, and functions as a data processing apparatus 1 in theexternal memory device 52. In the description which follows, the datatransmitting apparatus 1 according to the third embodiment will bereferred to as the data processing apparatus 1.

Arrangement of the external memory device!

The external memory device 52 which incorporates the data processingapparatus 1 according to the third embodiment comprises a disk recordingand reproducing device using a magnetooptical disk, for example, as arecording medium. As shown in FIG. 19, the external memory device 52comprises a cartridge holder (not shown) for inserting therein a diskcartridge (not shown) in which a magnetooptical disk D of the magneticfield-modulated type is rotatably housed, a spindle motor 151 forrotating the magnetooptical disk D in the disk cartridge inserted in thecartridge holder, an optical pickup 152 for reproducing an informationsignal from the magnetooptical disk D, and a recording magnetic fieldgenerator 153 for applying a recording magnetic field to themagnetooptical disk D that is being rotated by the spindle motor 151 tomagnetize, according to a recording signal, a spot (heated to atemperature in excess of the Curie point) in a perpendicularlymagnetized film (recording layer) of the magnetooptical disk D which isirradiated by a laser beam L emitted from the optical pickup 152. InFIG. 19, the disk cartridge is omitted from illustration for the sake ofbrevity.

The cartridge holder has a known shutter opening/closing mechanism (notshown) for selectively opening and closing a shutter (not shown) of thedisk cartridge.

When the disk cartridge is inserted into the cartridge holder, theshutter thereof is opened by the shutter opening/closing mechanism. Whenthe shutter is fully opened by the shutter opening/closing mechanism,i.e., when the disk cartridge is fully inserted into the cartridgeholder, the loading of the disk cartridge into the external memorydevice 52 is finished.

The spindle motor 151 is positioned below a central region of the loadeddisk cartridge, and can vertically be moved toward and away from thedisk cartridge by a known spindle motor lifting/lowering mechanism (notshown) which is mainly composed of a stepping motor and a mechanism forconverting rotary motion into linear motion. The spindle motor 151 has amotor shaft connected at its upper end a turntable 154 having a magnet.

In response to the loading of the disk cartridge, the spindle motor 151is moved upwardly by the spindle motor lifting/lowering mechanism tocause the turntable 154 to enter the disk cartridge through an openingin a lower panel of the disk cartridge. At this time, the upper surfaceof the turntable 154 and the center hub of the magnetooptical disk D inthe disk cartridge are attracted to and held against each other by themagnet, and the magnetooptical disk D in the disk cartridge is mountedon the spindle motor 151.

The optical pickup 152 is positioned below the opening in the lowerpanel of the disk cartridge which is exposed in the external memorydevice 52. The optical pickup 152 is movable radially across themagnetooptical disk D in the disk cartridge by a known optical pickupslide mechanism 155 which primarily comprises a linear motor and a guideshaft.

The optical pickup 152 has an objective lens (not shown) for converginga laser beam L from a laser beam source onto the recording layer of themagnetooptical disk D. The objective lens is slightly movable indirections toward and away from the magnetooptical disk D and also indirections radially across the magnetooptical disk D by atwo-dimensional actuator 156. The two-dimensional actuator 156 comprisesa magnetic circuit composed of a focusing coil, a tracking coil, and amagnet, for example.

The recording magnetic field generator 153 is positioned above anopening defined in an upper panel of the disk cartridge which is exposedin the external memory device 52. The recording magnetic field generator153 is vertically movable toward and away from the opening in the upperpanel of the disk cartridge by a known lifting/lowering mechanism (notshown) which is mainly composed of a stepping motor and a mechanism forconverting rotary motion into linear motion. The recording magneticfield generator 153 is also movable radially across the magnetoopticaldisk D in ganged relation to the optical pickup 152 by an interlinkmechanism (not shown).

As shown in FIG. 19, the external memory device 52 has a circuitarrangement comprising a modulator 161, a magnetic field generator drivecircuit 162, a calculating circuit 163, a demodulator 164, a servocontroller 165, and a system controller 166 for controlling thesecircuits. The data processing apparatus 1 according to the thirdembodiment is connected to the system controller 166 through aninterface 167.

The data processing apparatus 1 is connected to the host computer 51disposed outside of the external memory device 52, through an interfacebus such as a SCSI bus and an interface 168 for data transfertherebetween.

The modulator 161 encodes recording data sent from the system controller166 with an error-correcting code or the like, converts the encoded datainto binary data, and outputs the binary data as an on/off signal.

Based on the on/off signal from the modulator 161, the magnetic fieldgenerator drive circuit 162 changes the direction of a current suppliedto an exciting coil in the magnetic field generator 153 between positiveand negative directions.

Specifically, when a current is supplied in a positive direction to theexciting coil, the spot in the recording layer of the magnetoopticaldisk D whose temperature is in excess of the Curie point by beingirradiated with the laser beam from the optical pickup 152 is magnetizedin a positive direction, for example. When a current is supplied in anegative direction to the exciting coil, the spot is magnetized in anegative direction, for example.

Subsequently, a reproducing laser beam L is applied from the opticalpickup 152 to the positively or negatively magnetized spot. The Kerrangle in a reflected beam which is modulated by the positively ornegatively magnetized spot is detected by a light detector composed of apn-junction photodiode, for thereby obtaining a reproduced signalrepresentative of magnetized information recorded on the magnetoopticaldisk D.

The servo controller 165 has therein a focusing servo control circuit, atracking servo control circuit, a spindle servo control circuit, and amotor servo control circuit for controlling a motor serving as a drivesource for the various moving mechanisms. These servo control circuitsare supplied with servo control data (servo gains, etc.) and servo drivecontrol signals such as drive signals from the system controller 166,and also with calculated servo control signals from the calculatingcircuit 163.

The spindle servo control circuit is a circuit responsive to a servodrive control signal from the system controller 166 for energizing thespindle motor 151 to rotate the magnetooptical disk D mounted on theturntable 154 at CLV (Constant Angular Velocity) or CAV (Constant LinearVelocity). If the magnetooptical disk D is a sample servo disk, forexample, then the servo drive control signal is generated based on aclock signal that is produced by frequency-dividing, with a PLL, a pulsesignal generated upon detection of clock pits which are formed togetherwith servo pits in a servo area of the magnetooptical disk D.

The focusing servo control circuit is a circuit for driving andcontrolling the two-dimensional actuator 156 for the optical pickup 152to move the objective lens toward and away from the magnetooptical diskD, based on a signal produced by effecting given calculations, with thecalculating circuit 163, on a detected signal depending on the intensityof light reflected from a mirror on the magnetooptical disk D uponapplication of the laser beam to the mirror.

The tracking servo control circuit is a circuit for driving andcontrolling the two-dimensional actuator 156 for the optical pickup 152to move the objective lens radially across the magnetooptical disk D,based on a tracking error signal from the calculating circuit 163,specifically a signal produced by effecting given calculations, with thecalculating circuit 163, on a detected signal produced upon detection ofservo pits in the servo area of the magnetooptical disk D.

The demodulator 164 is a circuit for converting a reproduced signal fromthe calculating circuit 163, specifically a signal produced by effectinggiven calculations on P- and S-polarized components of reflected lightmodulated according to magnetized information recorded in the recordinglayer of the magnetooptical disk D, into digital data, decoding a codesuch as an error-correcting code or the like added to the digital data,and outputting the digital data as reproduced data. The reproduced datafrom the demodulator 154 is supplied to the system controller 166.

The reproduced data supplied to the system controller 166 is supplied tothe data processing apparatus 1 through the interface 167 and theinterface bus (e.g., a SCSI bus). Address data contained in thereproduced data supplied to the system controller 166 is used to controlthe rotation of the spindle motor 151 and the scanning position of theoptical pickup 152 in a seek mode.

Arrangement of the data processing apparatus according to the thirdembodiment!

The data processing apparatus 1 according to the third embodiment willbe described below with reference to FIGS. 20 through 42. As shown inFIG. 20, the data processing apparatus 1 comprises, as its hardwarecomponents, a program ROM 171 storing various programs, a data ROM 172registering various fixed data, a working RAM 173 used to execute aprogram read from the program ROM 171, a data RAM 174 for storingreproduced data from the system controller 166, recording data from thehost computer 51, and data processed by various programs, an input port175 and an output port 176 for inputting data from and outputting datato external circuits, a data compression circuit 178 for compressingdata stored in the data RAM 174 using a dedicated buffer memory 177, adata expansion circuit 180 for expanding data stored in the data RAM 174using a dedicated buffer memory 179, and a CPU (control andlogic/arithmetic unit) 181 for controlling these circuits.

The data compression circuit 178 and the data expansion circuit 180 arecircuits for compressing and expanding data in a loss-less manner, i.e.,producing loss-less compressed and expanded data, and may each comprisea microcomputer or the like. While the loss-less data compressiontechnique itself used by the data compression circuit 178 and the dataexpansion circuit 180 has no direct bearing on the present invention andhence will not be described in detail, it may be the LZW compressingtechnique, for example, used in the data transmitting apparatus 1according to the first and second embodiments.

The various circuits transfer data through a data bus DB extending fromthe CPU 181, and are controlled by the CPU 181 through a control bus(not shown) extending from the CPU 181.

Recording data inputted from the host computer 51 through the interfacebus and the interface 168 and response data inputted from the systemcontroller 166 through the interface bus and the interface 168 aresupplied through the input port 175 to the data bus DB.

Reproduced data or the like stored in the data RAM 174 and destined forthe host computer 51 is supplied to the host computer 51 through theinterface bus and the interface 168. Various drive request signals andrecording data (compressed data or uncompressed data) stored in the dataRAM 174 and destined for the system controller 166 are supplied to thesystem controller 166 through the output port 176, the interface bus,and the interface 167.

Arrangement of the recording format of the magnetooptical disk!

Prior to describing operation of the external memory device 52 primarilybased on operation of the data processing apparatus 1 according to thethird embodiment, the format of the magnetooptical disk D loaded in theexternal memory device 52 will be described below with reference to FIG.21. The magnetooptical disk D has ten thousands tracks having tracknumbers (track addresses) "0"-"9999" that are successively arrangedradially from a radially outer side (circumferentially outermost side)toward a radially inner side (circumferentially innermost side). Thus,the magnetooptical disk D have tracks 0-9999.

The tracks 0-2 and the tracks 9948-9999 are tracks supervised by thedata processing apparatus 1 and the system controller 166 of theexternal memory device 52. Of these tracks, the tracks 9948-9996 belongto an alternate area AE as described later on, and the tracks 0-2,9997-9999 belong to a drive area DE supervised by the data processingapparatus 1 and the system controller 166 of the external memory device52. The remaining tracks 3-9947 belong to a user area UE.

The drive area DE will record preferably uncompressed data for speedingup access for data reading and writing. The user area UE and thealternate area AE will selectively record data compressed by the datacompression circuit 178 and uncompressed data depending on certainconditions, as described later on.

Each of the tracks has sectors having physical sectors numbers "0"-"24"(these sectors may be referred to as physical sectors 0-24 or simplysectors 0-24 if their meaning is apparent in the context, or may bereferred to as sector addresses). One sector has a memory capacity (datarecording capacity) of 2048 bytes.

The host computer 51 to which the external memory device 52 is connectedrecords or reads data in units of 100 sectors, for example. If one unitof data handled by the host computer 51 in one access cycle is calledone block, then the data length of one block is 100 sectors in a sectorrepresentation, and 100×2 Kbytes=200 Kbytes in a byte representation.

The host computer 51 supervises or handles data in 200-Kbyte blocks eachcomposed of 100 sectors. Specifically, the host computer 51 supervisesthe sector 0 of the track 3 in the user area UE as a starting address 0of data of one block, and also supervises starting addresses ofrespective subsequent blocks or every 100 sectors as sector addresses100, 200, . . .

However since data recorded in the user area UE may actually becompressed data, the sector addresses of data of one block supervised bythe host computer 51 may not correspond uniquely to the sector addresseson the magnetooptical disk D. In this sense, the sector addressessupervised by the host computer 51 may be the to be logic sectoraddresses not governed by the recording format of the recording mediumsuch as the magnetooptical disk D, and the sector addresses supervisedby the data processing apparatus 1 of the external memory device 52 maybe the to be physical sector addresses governed by the actual recordingformat of the magnetooptical disk D.

Therefore, the sector addresses supervised by the host computer 51 willhereinafter be referred to as logic sector addresses, and the sectoraddresses supervised by the data processing apparatus 1 will hereinafterbe referred to as physical sector addresses.

Data of one block that can be supervised by the host computer 51 willhereinafter be referred to as data of one logic block, and data of oneblock that can be supervised by the data processing apparatus 1 willhereinafter be referred to as data of one physical block. For example,when the expected compression ratio β in the data compression circuit178 is 2, if the data length of one logic block is 100 sectors, then thedata length of one physical block is 50 sectors.

To facilitate the supervision of the correspondence between the logicsector addresses of data of one block before it is compressed and thephysical sector addresses of data of one block after it is compressed,there is employed a file allocation table FAT in this embodiment. Thefile allocation table FAT will be described later on.

Both the logic sector addresses and the physical sector addresses arerelative sector addresses with the starting address of the user area UEbeing 0. While the physical sector addresses may be defined as absolutesector addresses with the starting address of the track 0 being 0, sinceaddress calculations would be complex, the physical sector addressesshould be relative sector addresses as with the logic sector addressesfor better calculations.

In this embodiment, the number of sectors of one physical block is 50 asdescribed above. However, this value may freely be changed according tospecifications. For example, the number of sectors of one physical blockmay be 1. In this case, when the expected compression ratio β is 2, thenumber of sectors of one logic block is 2.

In FIG. 21, the sector 0 of the track 0 is a DDS (Disk DefinitionStructure) sector #0 for recording attributes, such as informationindicating ID, an initialized status, or the like, and a file allocationtable FAT, and the sector 1 of the track 0 is a PDL (Primary DefectList) sector #0 for recording information of a defect sector when thedisk is certified.

The sector 2 of the track 0 is an SDL (Secondary Defect List) sector #0for recording information of a defect sector when data is written andverified after the disk is certified. Data recorded in the DDS sector#0, the PDL sector #0, and the SDL sector #0 are collectively referredto as attribute data, and areas (the DDS sector #0, the PDL sector #0,and the SDL sector #0) for recording these attribute data arecollectively referred to as attribute data recording areas.

The DDS sector #1, the PDL sector #1, and the SDL sector #1 as thesectors 12, 13, 14 of the track 1, the DDS sector #2, the PDL sector #2,and the SDL sector #2 as the sectors 0, 1, 2 of the track 9997, and theDDS sector #3, the PDL sector #3, and the SDL sector #3 as the sectors12, 13, 14 of the track 9998 record therein the same data as theattribute data recorded in the DDS sector #0, the PDL sector #0, and theSDL sector #0 as the sectors 0, 1, 2 of the track 0, and function asso-called backup sectors.

The contents of the DDS sector #0 of the track 0 will be described belowwith reference to FIG. 22. Two bytes at byte numbers 0, 1 represent anID (identification) of the DDS sector, and record therein "0A: BCDhexadecimal notation". Byte numbers 2, 2047 are reserved (undefined),and record therein "00". A byte at a byte number 3 records thereininformation as to whether the disk has been certified or not. If thedisk has been certified, then "01" is recorded at the byte number 3, andif the disk has not been certified, then "02" is recorded at the bytenumber 3. Therefore, when a disk certifying process (initializingprocess) described later on is finished, the data recorded at the bytenumber 3 in the DDS sector #0 is changed from "02" to "01".

Areas indicated by byte numbers P, P+1, . . . , P+Q contain fileallocation tables FAT indicative of the correspondence between the logicsector addresses of data of one logic block, before it is compressed,received from the host computer 51 and the physical sector addresses ofdata of one physical block, after it is compressed, recorded in the userarea UE and the alternate area AE of the magnetooptical disk D. Asdescribed above, data are recorded in the file allocation tables FAT inan uncompressed form.

Arrangement of the file allocation table FAT!

As shown in FIG. 23, one record length in the file allocation table FATis 15 bytes, and the file allocation table FAT is composed of aplurality of records each having a data storage capacity of 15 bytes.Each of the records is composed of former 6 bytes and latter 9 bytes.The former 6 bytes represent data management information in the hostcomputer 51. Of the former 6 bytes, the first 3 bytes serve as an area(starting logic sector address storage area) "a" for storing a startinglogic sector address of data of one logic block, and the next 3 bytes asan area (final logic sector address storage area) "b" for storing afinal logic sector address of data of the same logic block.

The latter 9 bytes represent data management information on themagnetooptical disk D. Of the latter 9 bytes, the first 3 bytes serve asan area (starting physical sector address storage area) "c" for storinga starting physical sector address of data of one physical block, thenext 3 bytes as an area (final physical sector address storage area) "d"for storing a final physical sector address of data of the same physicalblock, and the next 3 bytes as an area (link address storage area) "e"for storing a link address. The content of each of the records is 0 inthe initial state.

One record of the file allocation table FAT stores a physical sectoraddress of data of one physical block corresponding to a logic sectoraddress of data of one logic block. Specifically, if data of one logicblock can be compressed at the expected compression ratio β asprescribed, the sector size of the data of one logic block is compressedat the sector size of the data of one physical block. If the expectedcompression ratio is 2, for example, then data of one logic block having100 sectors becomes data of one physical block having 50 sectors.

According to the loss-less data compression technique, however, data ofone logic block may not necessarily be compressed at the above expectedcompression ratio. The compression ratio may be lower than the expectedcompression ratio β depending on the contents of the data of one logicblock. In such a case, the data length of data of one physical blockexceeds 50 sectors. According to the present embodiment, a startingphysical sector address which has recorded data in excess of 50 sectorsis stored as a link address in the link address storage area "e" inorder to keep correspondence between the data of a physical block andthe data of a logic block.

Concurrent with the storage of the link address, the link address isstored into the starting physical sector address storage area "c" of arecord next to the above record, and the final physical sector addressof a physical block where the data in excess of 50 sectors is storedinto the final physical sector address storage area "d". At this time,"0" is stored into the starting logic sector address storage area "a"and the final logic sector address storage area "b" of the record.

"FFFF00" or "FFFF01" is stored into the link address storage area "e" ofa record corresponding to a final block of a plurality of physicalblocks corresponding to one logic block.

Description of operation of the data processing apparatus according tothe third embodiment!

The principles of operation of the data processing apparatus 1 accordingto the third embodiment will be described below on the assumption thatthe expected compression ratio β in the data compression circuit 178 is2, the data length of one logic block is 100 sectors, and the datalength of one physical block is 50 sectors.

When data of one logic block supplied from the host computer 51 to thedata processing apparatus 1 is compressed by the data compressioncircuit 178, if the data length of the compressed data is 50 sectors orless, then the actual compression ratio ε thereof is 2 or greater,allowing the data of one logic block to be accommodated in one physicalblock.

At this time, in the corresponding record of the file allocation tableFAT, the starting physical sector address of the above one physicalblock is stored into the starting physical sector address storage area"c" in a manner to correspond to the starting logic sector address, thefinal physical sector address of the same physical block is stored intothe final physical sector address storage area "d", and informationindicating that no next link address exists and that compressed data isrecorded in this physical block, i.e., "FFFF01", is stored into the linkaddress storage area "e" (see the contents of the record 2 shown in FIG.23).

If the data length of the compressed data is greater than 50 sectors,then the actual compression ratio ε thereof is smaller than the expectedcompression ratio β=2, preventing the data of one logic block from beingaccommodated in one physical block. As a result, the data of one logicblock has the same data length as two physical blocks, i.e., one logicblock.

In this case, the data (uncompressed data) supplied from the hostcomputer 51, rather than compressed data, is directly recorded on themagnetooptical disk D at the corresponding physical address.

At this time, in the corresponding record of the file allocation tableFAT, the starting physical sector address of first one physical block isstored into the starting physical sector address storage area "c" in amanner to correspond to the starting logic sector address, the finalphysical sector address of the same physical block is stored into thefinal physical sector address storage area "d", and the startingphysical sector address of next one physical block is stored into thelink address storage area "e".

In a next record, "0" is stored into the starting logic sector addressstorage area "a" and the final logic sector address storage area "b",the starting physical sector address (the same as the link address) ofnext one physical block is stored into the starting physical sectoraddress storage area "c", the final physical sector address of the nextphysical block is stored into the final physical sector address storagearea "d", and information indicating that no next link address existsand that uncompressed data is recorded in this series of physicalblocks, i.e., "FFFF00", is stored into the link address storage area "e"(see the contents of the records 0, 1 shown in FIG. 23).

In this manner, it is not necessary to perform an extra process such asa data expansion process subsequently by recording uncompressed data,rather than compressed data having the same data length as one logicblock, when data is viewed in units of physical blocks, on themagnetooptical disk D. Therefore, the speed of access (transfer speed)from the magnetooptical disk D to the data processing apparatus 1 to thehost computer 51 is increased.

This holds true for an expected compression ratio β set to more than 2.If the expected compression ratio β is 3, then when the actualcompression ratio is 3/2 or greater, compressed data is recorded at thecorresponding physical address, and when the actual compression ratio issmaller than 3/2, uncompressed data is recorded at the correspondingphysical address.

More specifically, when the actual compression ratio is 3 or greater,data of one logic block is compressed to a size that can be accommodatedin one physical block. When the actual compression ratio E is in therange of 3/2≦ε<3, data of one logic block is compressed to a size thatcan be accommodated in two physical blocks. In these cases, thecompressed data is recorded. When the actual compression ratio εisε<3/2, data of one logic block, even though it is compressed, occupiesthree physical blocks having the same data length as one logic block. Inthis case, the uncompressed data is recorded.

Specific examples of the processing operation of the data processingapparatus according to the third embodiment!

Specific examples of the processing operation of the data processingapparatus 1 will be described below with reference to functional blocksand flowcharts shown in FIGS. 24 through 42.

As shown in FIG. 25, at the same time that the power supply is switchedon, the data processing apparatus 1 is initialized, e.g., its systemcheck, memory check, and set-up process are carried out in a step S401.

Then, in a step S402, a data processing means (data processing program:a means 201, see FIG. 24, for compressing data from the host computer 51and supplying the compressed data to the system controller 166, and forexpanding reproduced data from the system controller 166 andtransferring the expanded data to the host computer 51) is read from theprogram ROM 171 and written into the working RAM 173. At the same time,a working area for temporarily storing data generated during theexecution of the program 201 and for transferring parameters betweenroutines is allotted to the working RAM 173.

To the data RAM 174, there are allotted an initializing data storagearea for storing initializing data of one physical block, an attributedata storage area for storing attribute data of the magnetooptical diskD, a logic block data storage area for storing uncompressed data of onelogic block (e.g., 100 sectors) from the host computer 51, a compresseddata storage area for storing compressed data produced by compressinguncompressed data of one logic block, a data storage area for storingdata form the system controller 166, particularly data from the userarea UE (or the alternate area AE), an expanded data storage area forstoring expanded data, and an area occupied by a record status tablewhich represents record statuses of physical blocks on themagnetooptical disk D in a simple string of bits (the occupied area willhereinafter be referred to as a "record status table").

As shown in FIG. 24, the data processing program 201 read into theworking RAM 173 comprises a decision means 202 for making variousdecisions, a record status table generating means 203 for generating arecord status table representing record statuses of the user area UE, arequest processing means 204 for effecting processing based on a requestfrom the host computer 51, a disk unload requesting means 205 for makinga request to unload the magnetooptical disk D from the external memorydevice 52 according to a disk unload request from the host computer 51,and an attribute data reading means 206 for receiving attribute datasupplied from the system controller 166 through the interface 167 to theinput port 175.

The record status table generating means 203 has a decision means 207for making various decisions, a bit address calculating means 208 forcalculating a bit (bit address) corresponding to a physical sectoraddress read from the file allocation table FAT, in the string of bitsmaking up the record status table, and a set bit processing means 209for setting "1" in the bit corresponding to the bit address produced bythe bit address calculating means 208, in the record status table.

The request processing means 204 comprises a decision means 210 formaking various decisions, and various processing means 211 for effectingprocessing according to various requests from the host computer 51. Thevarious processing means 211 include an initializing means 301 (see FIG.29) for certifying (initializing) the magnetooptical disk D, a writingmeans 401 (see FIG. 32) for transferring compressed data stored in thecompressed data storage area in the data RAM 174 or uncompressed datastored in the logic block data storage area in the data RAM 174 to thesystem controller 166, a reading means 501 (see FIG. 38) for readingphysical blocks of data recorded in the user area UE (or the alternatearea AE) of the magnetooptical disk D, and a data deleting means 601(see FIG. 40) for deleting logic blocks of data recorded in the userarea UE of the magnetooptical disk D.

According to the data processing program 201, the decision means 202determines whether the disk cartridge is loaded or not based on adetected signal from a sensor which optically detects when the diskcartridge is inserted in the cartridge holder, in a step S403 shown inFIG. 25.

After the disk cartridge has been loaded and the magnetooptical disk Dhoused therein has been rotated at a CAV or CLV by the spindle motor151, control proceeds to a step S404 in which the attribute data readingmeans 206 outputs an attribute data readout request to the systemcontroller 166. The attribute data readout request includes parametersrepresenting a starting physical sector address of attribute datarecording areas and a readout sector size of the magnetooptical disk D.

Based on the attribute data readout request from the attribute datareading means 206 in the data processing apparatus 1, the systemcontroller 166 actuates the optical pickup slide mechanism 155 to feedthe optical pickup 152 to a position corresponding to the track 0 of themagnetooptical disk D. Then, the optical pickup 152 applies a laser beamL having a reproducing output power to the recording layer at the track0, and optically reproduces attribute data recorded in the attributedata recording areas and outputs a reproduced signal representing theattribute data. The reproduced signal from the optical pickup 152 isconverted by the demodulator 164 into reproduced data, which is suppliedto the system controller 166. The reproduced data supplied to the systemcontroller 166 is supplied through the interface 167 to the dataprocessing apparatus 1.

The reproduced data supplied to the data processing apparatus 1 isstored into the attribute data storage area of the data RAM 174 throughthe input port 175 and the attribute data reading means 206. The processof reading the attribute data is completed with the above series ofoperation.

In a next step S405, the decision means 202 determines whether an errorhas occurred in the above process of reading the attribute data. If anerror has occurred, then control goes back to the step S404 in which anattribute data readout request is outputted for reading attribute datarecorded in the attribute data recording area at the track 9997 (the DDSsector #2, the PDL sector #2, and the SDL sector #2).

If an error has also occurred in this reading process, then an attributedata readout request is outputted for reading attribute data recorded inthe attribute data recording area at the track 9998 (the DDS sector #3,the PDL sector #3, and the SDL sector #3).

If an error has occurred in the reading process for reading attributedata from all the attribute data recording areas, the magnetoopticaldisk D is regarded as being unusable, and message data representing thatthe magnetooptical disk D cannot be used is transferred to the hostcomputer 51. The host computer 51 displays a message "DISK CANNOT BEUSED" on a display unit such as a CRT, a liquid crystal display unit, orthe like which is connected to the host computer 51, indicating to theoperator that the magnetooptical disk D which is presently loaded cannotbe used.

It is very rare for the reading process for reading attribute data fromall the attribute data recording areas to suffer an error. Usually, theattribute data is read from the attribute data recording area at thetrack 0.

In a next step S406, the decision means 202 determines whether thepresently loaded magnetooptical disk D has been initialized or not basedon whether the data of the third byte in the attribute data stored inthe attribute data storage area is "01" or "02". If the data of thethird byte is "01" indicating that the presently loaded magnetoopticaldisk D has been initialized, control goes to a next step S407 in whichcontrol enters a record status table generating subroutine which is therecord status table generating means 203.

In this record status table generating subroutine, as shown in FIG. 26,the index register i is initialized, i.e., an initial value "0" isstored in the index register i, in a step S501.

In a next step S502, a record corresponding to the value of the indexregister i of the file allocation table FAT is selected among theattribute data stored in the attribute data storage area.

In a next step S503, the decision means 207 determines whether theselected record is effective or ineffective based on whether a startingphysical sector address and a final physical sector address are storedrespectively in the starting physical sector address storage area "c"and the final physical sector address storage area "d" of the selectedrecord. If starting and final physical sector addresses are storedrespectively in the starting and final physical sector address storageareas "c", "d", indicating that the record is effective, controlproceeds to a next step S504 in which the bit address calculating means208 calculates a bit (bit address) "b" corresponding to the physicalsector address in the string of bits making up the record status table.The bit address "b" is calculated according to b=S/m where S is thephysical sector address and m is the number of sectors of one physicalblock.

In a next step S505, the set bit processing means 209 sets a bitcorresponding to the bit address "b" calculated by the bit addresscalculating means 208 in the string of bits making up the record statustable, to "1". That is, bit setting processing is carried out.

In a next step S506, the content of the index register i is incrementedby +1. If starting and final physical sector addresses are not presentrespectively in the starting and final physical sector address storageareas "c", "d", e.g., if "0" is stored in both the starting and finalphysical sector address storage areas "c", "d", indicating that theselected record is ineffective, in the step S503, then control goes fromthe step S503 directly to the step S506 in which the content of theindex register i is incremented by +1.

In a next step S507, the decision means 207 determines whether thesearch process is finished or not based on whether the value of theindex register i is the same as the final record number N of the fileallocation table FAT or not. If the value of the index register i issmaller than the final record number N, then control returns to the stepS502 in which a next record is selected in the file allocation tableFAT.

When the value of the index register i becomes equal to the final recordnumber N or greater, the record status table generating subroutine isfinished. When the record status table generating subroutine isfinished, all the bits corresponding to the physical sector addresses ofthe physical tracks registered in the file allocation table FAT havebeen set to "1". Neither compressed data nor uncompressed data arerecorded in the physical sector addresses which corresponding to bits"0" in the string of bits making up the record status table.

The processing operation of the record status table generatingsubroutine will be described with reference to the specific contents ofthe file allocation table FAT shown in FIG. 23, for example. Thephysical sector addresses of the 0th, 1st, and 2nd records of the fileallocation table FAT are 2000, 2050, 5000, respectively. In thisexample, since the number of sectors of one physical block is 50, thebit addresses corresponding to the respective physical sector addressesare 40th, 41st, and 100th bits, respectively. As a result, as shown inFIG. 27, "1", is set in the 40th, 41st, and 50th bits in the string ofbits making up the record status table.

Referring back to the main routine shown in FIG. 25, if the presentlyloaded magnetooptical disk D has not been initialized, then control goesto a step S408 in which message data representing an initializationprompt is transferred to the host computer 51. The host computer 51 thendisplays a message "INITIALIZE DISK" on the display unit connectedthereto, indicating to the operator that the presently loadedmagnetooptical disk D has not been initialized. In this case, no recordstatus table is generated.

A next step S409 waits for a request from the host computer 51. If thereis a request from the host computer 51, then control proceeds to a stepS410, entering a request processing subroutine which is the requestprocessing means 204.

In the request processing subroutine which is shown in FIG. 28, thedecision means 210 determines whether the request from the host computer51 is an initialization request or not in a step S601. If the requestfrom the host computer 51 is an initialization request, then controlgoes to a next step S602, operating the initializing means 301(initializing subroutine) shown in FIG. 29.

As shown in FIG. 29, the initializing means 301 has a decision means 302for making various decisions, a PDL data generating means 303 forgenerating a sector address reference table in the PDL sector #0 of theattribute data in order to use a sector in the alternate area AE insteadof a sector suffering a readout error in the user area UE, a writerequest data generating means 304 for generating request data to recordphysical blocks of initializing data read from the data ROM 172 on themagnetooptical disk D, a write requesting means 305 for outputting writerequest data generated by the write request data generating means 304 tothe system controller 166, a read request data generating means 306 forgenerating request data to read physical blocks of initializing datarecorded on the magnetooptical disk D, a read requesting means 307 foroutputting read request data generated by the read request datagenerating means 306 to the system controller 166, and an attribute datawriting means 308 for outputting a request to record generated andupdated attribute data in the attribute data recording areas in thetracks 0, 1, 9997, 9998 to the system controller 166. As described lateron, the attribute data writing means 308 is associated with the writingmeans 401 and the data deleting means 601 as well as the initializingmeans 301.

According to the initializing means 301, i.e., the initializingsubroutine, as shown FIG. 30, initializing data (uncompressed data) ofone physical block is read from the data ROM 172 in a step S701, and theread initializing data is stored into the initializing data storage areaof the data RAM 174 in a step S702.

In a next step S703, the index register i and an index register k areinitialized, i.e., an initial value "0" is stored in the index registersi, k.

In a next step S704, the write request data generating means 304generates write request data to record initializing data on themagnetooptical disk D. Specifically, write request data is generated byadding write data (initializing data) to a header in which there arerecorded an identification code indicative of a write request, a writestarting sector address, and a write data length.

An absolute sector address is registered as the write starting sectoraddress. Specifically, an absolute sector address which is produced byadding the number of starting sectors (3 tracks×the number (25) ofsectors in a track=75 sectors) of the user area UE to a value which isthe product of the value of the index register i and the number m ofsectors of one physical block, is registered as the write startingsector address in the header. The number m of sectors of one physicalblock is also registered as the write data length in the header.

In a next step S705, the write request means 305 transfers the writerequest data through the interface 167 to the system controller 166.

Based on the write request data from the data processing apparatus 1,the system controller 166 removes the write starting sector address fromthe header of the write request data, and then actuates the opticalpickup slide mechanism 155 to move the optical pickup 152 to a trackposition corresponding to the absolute sector address.

Thereafter, the system controller 166 outputs the supplied write data(initializing data) to the modulator 161. The system controller 166 addsan error-correcting code to the supplied write data, and converts thewrite data into a binary signal which is supplied to the magnetic fieldgenerator drive circuit 162. Depending on the supplied binary signal,the magnetic field generator drive circuit 162 changes the direction ofan exciting current to a positive or negative direction, enabling therecording magnetic field generator 153 to generate a positive ornegative external magnetic field depending on the binary signal. Upondetection of the corresponding starting address, the optical pickup 152emits a laser beam L having a recording output power to a spot on themagnetooptical disk D thereby to magnetize the spot in a direction alongthe external magnetic field, thus recording the initializing data asmagnetizing information over sectors corresponding to one physical blockfrom the corresponding starting address.

In a next step S706, an index register j is initialized, i.e., aninitial value "0" is stored in the index register j.

In a next step S707, the read request data generating means 306generates read request data to read sectors of the initializing datawhich has been recorded on the magnetooptical disk D in the step S705.Specifically, read request data is generated in which there are recordedan identification code indicative of a read request, a read startingsector address, and a read data length. An absolute sector address isregistered as the read starting sector address. Specifically, anabsolute sector address which is produced by adding the number ofstarting sectors (3 tracks×the number (25) of sectors in a track=75sectors) of the user area UE to the value of the index register j, isregistered as the read starting sector address, and one physical sectoris registered as the read data length.

In a next step S708, the read request means 307 transfers the readrequest data through the interface 167 to the system controller 166.

Based on the read request data from the data processing apparatus 1, thesystem controller 166 removes the read starting sector address from theread request data, and then actuates the optical pickup slide mechanism155 to move the optical pickup 152 to a track position corresponding tothe absolute sector address.

Thereafter, upon detection of the corresponding starting address, theoptical pickup 152 emits a laser beam L having a reproducing outputpower to optically reproduce the initializing data recorded in thecorresponding sector, and outputs a reproduced initializing data as areproduced signal. The reproduced signal from the optical pickup 152 isconverted by the demodulator 164 into reproduced data which is suppliedto the system controller 166. The reproduced data supplied to the systemcontroller 166 is supplied directly to the data processing apparatus 1through the interface 167.

In the event of a readout failure of the optical pickup 152 for somereason, the system controller 166 outputs a readout error signal,instead of reproduced data, to the data processing apparatus 1.

In a next step S709, the decision means 302 determines whether a readouterror signal has been inputted or not. If a readout error signal hasbeen inputted, then control goes to a next step S710 in which PDL datais generated by the PDL data generating means 303.

The PDL data is data to be stored in the PDL sector #0, among theattribute data stored in the attribute data storage area. Specifically,the PDL sector #0 is an area for storing information of an error sector(defective sector) of the user area UE. In this example, the PDL sector#0 stores a reference table which stores a physical sector addresssuffering the readout error in the user area UE and the physical sectoraddress of an alternate area into which data to be recorded in thephysical sector address is retreated (recorded).

More specifically, the reference table is composed of an array ofrecords each having a data storage capacity of 6 bytes. Each of therecords has first 3 bytes storing a physical sector address suffering areadout error in the user area UE and next 3 bytes storing the physicalsector address of an alternate area.

In the step S710, a physical address (=the value of the index registerj×the number m of sectors of one physical block) suffering a readouterror in the user area UE, and the physical sector address (=the valueof the index register k) of an alternate area are stored in a recordcorresponding to the value of the index register k in the referencetable.

In a next step S711, the index register k is incremented by +1. In anext step S712, the index register j is incremented by +1.

If it is determined in the step S709 that the initializing data isnormally read, then no PDL data is generated, but control jumps to thestep S712 in which the index register j is incremented by +1.

In a next step S713, the decision means 302 determines whether thereading of sectors of the initializing data of one physical block thathas presently been recorded is completed or not based on whether thevalue of the index register j is at least the number m of sectors of onephysical block. If the value of the index register j is smaller than thenumber m of sectors, then control goes back to the step S707 in whichinitializing data of a next sector is read.

If the reading of sectors of the initializing data of one physical blockthat has presently been recorded is completed, then control goes to anext step S714 in which the decision means 302 determines whetherinitializing data has been recorded in all the sectors of the user areaUE or not based on whether the value of the index register i is at leastthe number M of physical blocks of the user area UE. If value of theindex register i is smaller than the number M of physical blocks, thencontrol returns to the step S704 in which initializing data is recordedin a next physical block, and sectors of the initializing data are read.

If value of the index register i is equal to or greater than the numberM of physical blocks, then control proceeds to a step S715 in which data("02") of the 3rd byte of the DDS sector #0 is replaced with 1-byte dataindicating that the disk has been certified, i.e., "01", among theattribute data stored in the attribute data storage area.

In a next step S716, control enters an attribute data writing subroutinewhich is the attribute data writing means 308. According to theattribute data writing subroutine, as shown in FIG. 31, write requestdata for writing the attribute data stored in the attribute data storagearea into the sectors 0-2 on the track 0 on the magnetooptical disk D isgenerated in a step S801. Specifically, the write request data isgenerated by adding 3 sectors of attribute data to a header in whichthere are registered an identification code indicative of a writerequest, a write starting sector address, and a write data length. Inthis case, 0 is registered as the write starting sector address in theheader, and the number of sectors =3 is registered as the write datalength in the header.

In a step S802, the write request data is transferred to the systemcontroller 166 through the interface 167.

Based on the write request data from the data processing apparatus 1,the system controller 166 controls the servo controller 165 and variousmechanisms, and enables the recording magnetic field generator 153 torecord attribute data in the sectors 0-2 on the track 0 on themagnetooptical disk D.

In a next step S803, write request data for writing the attribute datastored in the attribute data storage area into the sectors 12-14 on thetrack 1 on the magnetooptical disk D is generated. Specifically, thewrite request data is generated by registering 12 as a write startingsector address and the number of sectors =3 as a write data length in aheader, and further adding 3 sectors of attribute data.

In a step S804, the write request data is transferred to the systemcontroller 166 through the interface 167.

Based on the write request data from the data processing apparatus 1,the system controller 166 controls the servo controller 165 and variousmechanisms, and enables the recording magnetic field generator 153 torecord attribute data in the sectors 12-14 on the track 1 on themagnetooptical disk D.

Then, in a step S805, write request data for writing the attribute datastored in the attribute data storage area into the sectors 0-2 on thetrack 9997 on the magnetooptical disk D is generated. Specifically, thewrite request data is generated by registering 9997×25=249925 as a writestarting sector address and the number of sectors =3 as a write datalength in a header, and further adding 3 sectors of attribute data.

In a step S806, the write request data is transferred to the systemcontroller 166 through the interface 167.

Based on the write request data from the data processing apparatus 1,the system controller 166 controls the servo controller 165 and variousmechanisms, and enables the recording magnetic field generator 153 torecord attribute data in the sectors 0-2 on the track 9997 on themagnetooptical disk D.

Then, in a step S807, write request data for writing the attribute datastored in the attribute data storage area into the sectors 12-14 on thetrack 9998 on the magnetooptical disk D is generated. Specifically, thewrite request data is generated by registering 9998×25=249962 as a writestarting sector address and the number of sectors =3 as a write datalength in a header, and further adding 3 sectors of attribute data.

In a step S808, the write request data is transferred to the systemcontroller 166 through the interface 167.

Based on the write request data from the data processing apparatus 1,the system controller 166 controls the servo controller 165 and variousmechanisms, and enables the recording magnetic field generator 153 torecord attribute data in the sectors 12-14 on the track 9998 on themagnetooptical disk D.

The attribute data writing subroutine is now finished, whereupon themain routine thereof, i.e., the initializing subroutine, is alsofinished.

If the request from the host computer 51 is not an initializationrequest in the step S610 of the request processing subroutine shown inFIG. 28, then control goes to a next step S603 in which the decisionmeans 210 determines whether the request from the host computer 51 is awriting request or not.

If the request from the host computer 51 is a writing request, thencontrol goes to a step S604, operating the initializing writing means401 or executing a writing subroutine shown in FIG. 32.

As shown in FIG. 32, the initializing writing 401 has, in addition tothe attribute data writing means 308, a decision means 402 for makingvarious decisions, an FAT generating means 403 for generating andupdating a file allocation table FAT, a data output means 404 foroutputting a request to record compressed data or uncompressed data intoa corresponding physical block in the user area UE on the magnetoopticaldisk D to the system controller 166, a data receiving means 405 forreceiving write request data supplied from the host computer 51 throughthe interface 168 to the input port 175, and storing the write requestdata into a predetermined storage area of the data RAM 174, a compresseddata storing means 406 for reading compressed data outputted from thedata compression circuit 178, and storing the compressed data into thecompressed data storage area of the data RAM 174, and a compressionratio calculating means 407 for calculating an actual compression ratiobased on the data length of the pre-compression data and the data lengthof the compressed data.

The FAT generating means 403 has an address storing means 408 forstoring address information such as a physical sector addresscorresponding to a logic sector address into the corresponding record ofthe file allocation table FAT stored in the attribute data storage area,a random individual record searching means 409 for searching for bitinformation on the record status table for randomly recording compresseddata or uncompressed data in units of one physical block, a randomsuccessive record searching means 410 for searching for bit informationon the record status table for recording two or more successivecompressed data or uncompressed data in successive physical sectoraddresses, and an error processing means 411 for processing an error inthe event that there is no area available for recording compressed dataor uncompressed data.

The data output means 404 has a write request data generating means 412for generating write request data to record physical blocks ofcompressed data or uncompressed data on the magnetooptical disk D, and awrite requesting means 413 for outputting write request data generatedby the write request data generating means 412 to the system controller166.

According to the writing means 401, i.e., the writing subroutine, asshown in FIG. 33, the decision means 402 determines, in a step S901,whether the magnetooptical disk D loaded in the external memory device52 has been initialized or not based on whether the 1-byte data of thethird byte in the attribute data stored in the attribute data storagearea is "01" or not.

If the 1-byte data is "01" indicating that the magnetooptical disk D hasbeen initialized, control goes to a next step S902 in which the datareceiving means 405 receives write request data supplied from the hostcomputer 51 through the input port 51. The write request data iscomposed of a header including an identification code indicative of awrite request, a write starting sector address (starting logic sectoraddress), and a write data length (100 sectors in this example), and onelogic block (100 sectors) of write data.

In a next step S903, the received write request data is then stored intothe logic block data storage area allotted to the data RAM 174, and datarelative to the data length of the write data contained in the header isstored into the third register R3.

In a next step S904, one logic block (100 sectors) of write data amongthe write request data stored in the logic block data storage area isoutputted to the data compression circuit 178. The data compressioncircuit 178 compresses the supplied write data in a loss-less manner,i.e., produces loss-less compressed data using the buffer memory 177, ina step S905.

In a next step S906, the compressed data storage means 406 reads thecompressed data outputted from the data compression circuit 178, andstores the compressed data into the compressed data storage area of thedata RAM 174. At this time, the number of bytes, for example, from thestart of the compressed data to the end of the compressed data iscounted, and the counted number is stored as the data length of thecompressed data in the fourth register R4.

In a next step S907, the compression ratio calculating means 407calculates an actual compression ratio ε based on the data length of thewrite data and the data length of the compressed data. Specifically, theactual compression ratio e is calculated by dividing the data length ofthe write data stored in the third register R3 by the data length of thecompressed data stored in the fourth register R4. The quotient is storedas the actual compression ratio ε in a fifth register R5.

In a next step S908, the decision means 402 determines whether the datatransferred from the host computer 51 is used as it is or the compresseddata is used, based on whether the actual compression ratio e stored inthe fifth register R5 is in the range of 0<ε<β/(β-1) or not where β isthe expected compression ratio. This is because if the actualcompression ratio ε is in the range of 0<ε<β/(β-1), then the data lengthof the compressed data, particularly the data length determined by thenumber of physical blocks, is substantially the same as or greater thanthe data length determined by one logic block. In this case, the writedata (uncompressed data) from the host computer 51, rather than thecompressed data, is recorded on the magnetooptical disk D.

If the actual compression ratio ε is in the range of 0<ε<β/(β-1) in thestep S908, then control proceeds to a next step S909 in which parametersfor the uncompressing process. Specifically, "0" indicating theuncompressing process is stored into the first register R1, and theexpected compression ratio β is stored into the second register R2.

If the actual compression ratio e is equal to or greater than β/(β-1) inthe step S908, then control goes to a step S910 in which parameters forthe compressing process. Specifically, "1" indicating the compressingprocess is stored into the first register R1, and the value (β/ε)produced by dividing the expected compression ratio β by the actualcompression ratio e is stored into the second register R2.

Control then proceeds to a step S911, entering a FAT generatingsubroutine which is the FAT generating means 403. According to the FATgenerating subroutine shown in FIG. 34, a table data storage area forgenerating a present file allocation table is kept in the data RAM 174in a step SA01.

In a next step SA02, the index register j and an index register p areinitialized, i.e., an initial value "0" is stored in the index registersj, p.

In a next step SA03, control enters a random successive searchingroutine which is the random successive record searching means 410. Inthis random successive searching routine, data of a string of bits(hereinafter referred to as "bit string data") having a starting bit asthe value of the index register j in the record status table andindicated by the value in the second register R2 is read in the stepSA03.

A next step SA04 determines whether the content of the bit string datais 0 or not. If the content of the bit string data is not 0, i.e., ifthere is no area available for recording data which is a compressedlogic block of data from the host computer 51 or write data which is notcompressed, then control goes to a step SA05 in which control enters arandom individual record searching routine which is the randomindividual record searching means 409. In this random individual recordsearching routine, the step SA05 determines the 0th bit of the bitstring data is 0 or not.

If the 0th bit of the bit string data is "0", then it is equivalent to acondition in which data of one physical block can be recorded in aphysical sector address corresponding to the 0th bit of the bit stringdata. Therefore, the presently searched bit address, i.e., the value ofthe index register j, is stored into a record corresponding to the valueof the index register p in the bit address storage area kept in the dataRAM 174 in a step SA06.

In a next step SA07, the value of the index register p is incremented by+1, and in a next step SA08, the value of the index register j isincremented by +1.

If the 0th bit of the bit string data is "1" in the step SA05, nosearched bit address is stored into the bit address storage area, butcontrol goes directly to the step SA08 in which the value of the indexregister j is incremented by +1.

In a next step SA09, the decision means 402 determines whether thesearching process is finished or not based on whether the value of theindex register j is at least the number B of final bits to be searched,i.e., a value produced by subtracting the value, less 1, of the secondregister R2 from the number of final bits in the record status table.

If the value of the index register j is at least the number B of finalbits to be searched, then control returns to the step SA03, and thedecision process with respect to next bit string data is carried out inthe step SA03 and following steps.

The decision process is continued with respect to the bit string datawhile it is updated 1 bit each time. If any bit string data whosecontent is 0 is not found, then control goes to a step SA10 shown inFIG. 35.

In the step SA10, it is determined whether the bit address stored in thebit address storage area is stored for as many physical blocks asnecessary to record present compressed data or uncompressed data, basedon whether the value of the index register p is at least the value ofthe second register R2.

If value of the index register p is equal to or greater than the valueof the second register R2, then the bit address stored in the bitaddress storage area is determined as being stored for as many physicalblocks as necessary to record present compressed data or uncompresseddata. Control then goes to a step SA11 in which the index register k isinitialized, i.e., an initial value "0" is stored into the indexregister k.

In a next step SA12, the bit address stored in a record corresponding tothe value of index register k of the bit address storage area is storedinto the index register j.

In a next step SA13, control enters an address storing subroutine whichis the address storing means 408. According to the address storingsubroutine shown in FIG. 36, a bit corresponding to the value (bitaddress) of the index register j in the bit string of the record statustable is set to "1". That is, bit setting processing is carried out.

In a step SB02, a physical sector address is calculated on the basis ofthe value (bit address) of the index register j. The physical sectoraddress can be determined by multiplying the bit address j by the numberm of sectors of one physical block.

A next step SB03 determines whether the present value of the indexregister k is 0 or not, i.e., whether various data to be recorded in thetable data storage area are to be stored into the area of its 0threcord. If the value of the index register k is 0, then control proceedsto a step SB04 in which data of the 0th record to be stored in the tabledata storage area is generated.

Specifically, the starting logic sector address contained in the writerequest data from the host computer 51 is read and stored into astarting 3-byte area, i.e., the starting logic sector address storagearea "a", of the 0th record, and the sum of the starting logic sectoraddress and the number, e.g., 100, of sectors of one logic block isstored as the final logic sector address into a next 3-byte area, i.e.,the final logic sector address storage area "b".

The physical sector address determined in the step SB02 is stored into anext 3-byte area, i.e., the starting physical sector address storagearea "c", and the sum of the physical sector address and the number m,e.g., 50, of sectors of one physical block is stored as the finalphysical sector address into a next 3-byte area, i.e., the finalphysical sector address storage area "d". Then, the address storingsubroutine is finished.

If the value of the index register k is not 0 in the step SB03, thencontrol proceeds to a step SB05 in which data of the 1st record andfollowing records to be stored in the table data storage area isgenerated. Specifically, "0" is stored into a starting 3-byte area,i.e., the starting logic sector address storage area "a", of the 0threcord in the table data storage area, and "0" is stored as into a next3-byte area, i.e., the final logic sector address storage area "b".

The physical sector address determined in the step SB02 is stored into anext 3-byte area, i.e., the starting physical sector address storagearea "c", and the sum of the physical sector address and the number m,e.g., 50, of sectors of one physical block is stored as the finalphysical sector address into a next 3-byte area, i.e., the finalphysical sector address storage area "d". Furthermore, the physicalsector address is stored into the link address storage area "e" of therecord preceding this record, i.e., of the (k-1)th record. Then, theaddress storing subroutine is finished.

Control now goes back to the FAT generating subroutine (2) shown in FIG.35. The value of the index register k is incremented by +1 in a stepSA14.

In a next step SA15, it is determined whether the value of the indexregister k is at least the value of the second register R2. If the valueof the index register k is smaller than the value of the second registerR2, then control goes back to the step SA12 in which given data isstored into the table data storage area based on the bit address storedin the next record in the bit address storage area.

At the time the value of the index register k becomes equal to orgreater than the value of the second register R2 in the step SA15, therandom individual record searching routine executed by the randomindividual record searching means 409 is finished. Thereafter, controlproceeds to a step SA16. In the step SA16, the decision means 401determines whether the data to be recorded on the magnetooptical disk Dis uncompressed data or not based on whether the value of the firstregister R1 is "0" or not.

If the value of the first register R1 is "0", then control goes to astep SA17 in which 3-byte data "FFFF00" is stored into the link addressstorage area "e" of the final record in the table data storage areagenerated in the above address storing routine. If the value of thefirst register R1 is "1" and the data to be recorded on themagnetooptical disk D is compressed data, then control goes to a stepSA18 in which 3-byte data "FFFF01" is stored into the link addressstorage area "e" of the final record in the table data storage areagenerated in the above address storing routine. Now, the FAT generatingsubroutine is finished.

If the content of the bit string data is 0, i.e., if there is one areaor successive areas available for recording data which is a compressedlogic block of data from the host computer 51 or write data which is notcompressed, in the step SA04 shown in FIG. 34, then control goes to astep SA19 in which the index register k is initialized, i.e., an initialvalue "0" is stored into the index register k, while maintaining therandom successive record searching routine which is executed by therandom successive record searching means 410.

Then, in a next step SA20, control enters an address storing subroutine.Since this address storing subroutine is the same as the address storingsubroutine shown in FIG. 36, details of the address storing subroutinewill not be described below except that a given address such as aphysical sector address or the like which corresponds to the value (bitaddress) of the index register j is stored into a record correspondingto the value of the index register k in the table data storage area.

In a next step SA21, the values of the index registers j, k areincremented by +1.

In a next step SA22, it is determined whether the value of the indexregister k is at least the value of the second register R2. If the valueof the index register k is smaller than the value of the second registerR2, then control returns to the step SA20, and the step SA20 andfollowing steps are executed to store a given address such as a physicalsector address or the like relative to a next bit into a recordcorresponding to the value of the index register k in the table datastorage area.

If the value of the index register k is equal to or greater than thevalue of the second register R2 in the step SA22, then the randomsuccessive record searching routine which is executed by the randomsuccessive record searching means 410 is finished, and control goes tothe step SA16 shown in FIG. 35. The step SA16 and following steps areexecuted until the subroutine shown in FIG. 35 is finished.

If the value of the index register p is smaller than the value of thesecond register R2 in the step SA10, then it is determined that the bitaddress stored in the bit address storage area is not stored for as manyphysical blocks as necessary to record present compressed data oruncompressed data, i.e., the magnetooptical disk D has no area availablefor recording write data sent from the host computer 51. Control thengoes to a step SA23 in which the error processing means 411 effects anerror process, and forcibly ends the writing subroutine shown in FIG.33.

The error process may specifically be carried out by transferringmessage data for indicating that no data can be recorded to the operatorto the host computer 51, and displaying a message "CANNOT BE RECORDED"to the display unit connected to the host computer 51, therebyindicating to the operator that new data cannot be recorded on thepresently loaded magnetooptical disk D.

Referring back to the writing subroutine shown in FIG. 33, controlenters a data output subroutine which is the data output means 404 in astep S912. According to the data output subroutine shown in FIG. 37, theindex register i is initialized, i.e., an initial value "0" is stored inthe index register i, in a step SC02.

Then, in a next step SC02, an ith record is selected in the table datastorage area. In a next step SC03, the decision means 402 determineswhether the data to be recorded on the magnetooptical disk D iscompressed data or not based on whether the value of the first registerR1 is "1" or not.

If the value of the first register R1 is "1", then control goes to astep SC04 in which compressed data of one physical block (m sectors) isread from the compressed data storage area. If the value of the firstregister R1 is "0", then control goes to a step SC05 in which write data(uncompressed data) of one physical block (m sectors) is read from thelogic block data storage area.

In a next step SC06, the write request data generating means 412generates write request data to record compressed data or uncompresseddata on the magnetooptical disk D. Specifically, write request data isgenerated by adding compressed data or uncompressed data of one physicalblock to a header in which there are registered an identification codeindicative of a write request, a write starting sector address, and awrite data length.

An absolute sector address is registered as the write starting sectoraddress. Specifically, an absolute sector address which is produced byadding the number of starting sectors (3 tracks×the number (25) ofsectors in a track=75 sectors) of the user area UE to a physical sectoraddress which is stored in the starting physical sector address storagearea "c" of the ith record selected in the step SC02, is registered asthe write starting sector address in the header. The number m of sectorsof one physical block is also registered as the write data length in theheader.

In a next step SC07, the write request means 413 transfers the writerequest data through the interface 167 to the system controller 166.

Based on the write request data from the data processing apparatus 1,the system controller 166 controls the servo controller 165 and variousmechanisms, and enables the recording magnetic field generator 153 torecord compressed data or uncompressed data of one physical block (msectors) from an address indicated by the write starting sector addresscontained in the write request data on the magnetooptical disk D.

In a next step SC08, the decision means 402 determines whether a linkaddress exists or not based on whether there is a link address in thelink address storage area "e" of the ith record selected in the stepSC02. If there is a link address, then control proceeds to a step SC09in which the value of the index register i is incremented by +1.Thereafter, control returns to the step SC02 in which a next record inthe table data storage area is selected. Then, compressed data oruncompressed data of one physical block from the absolute sector address(write starting sector address) of the physical sector address stored inthe starting physical sector address storage area "c" of the selectedrecord is recorded on the magnetooptical disk D.

The above process is repeatedly carried out until it is determined inthe step SC08 that there is no link address in the link address storagearea "e" of the selected record. When it is determined that there is nolink address, the data output subroutine is brought to an end.

Referring back to the writing subroutine shown in FIG. 33, various datastored in the table data storage area are stored into empty records inthe file allocation table FAT among the attribute data stored in theattribute data storage area of the data RAM 174.

In a next step S914, control enters an attribute data writing subroutinewhich is the attribute data writing means 308. Since this attribute datawriting subroutine is the same as the attribute data writing subroutineshown in FIG. 31, details of the attribute data writing subroutine willnot be described below except that updated attribute data of 3 sectorsstored in the attribute data storage area of the data RAM 174 isrecorded in the sectors 0-2 of the track 0, the sectors 12-14 of thetrack 1, the sectors 0-2 of the track 9997, and the sectors 12-14 of thetrack 9998 on the magnetooptical disk D.

When the attribute data writing subroutine is finished, the writingsubroutine is also finished.

If the presently loaded magnetooptical disk D has not been initializedin the step S901, then message data representing an initializationprompt is transferred to the host computer 51. The host computer 51 thendisplays a message "INITIALIZE DISK" on the display unit connectedthereto, indicating to the operator that the presently loadedmagnetooptical disk D has not been initialized.

If the request from the host computer 51 is not a writing request in thestep S603 shown in FIG. 28, then control goes to a step S605 in whichthe decision means 210 determines whether the request from the hostcomputer 51 is a reading request or not.

If the request from the host computer 51 is a reading request, thencontrol goes to a step S606, entering a reading subroutine which is thereading means 501.

As shown in FIG. 38, the reading means 501 has a decision means 502 formaking various decisions, a data receiving means 503 for receiving readrequest data supplied from the host computer 51 through the interface168 to the input port 175, a read request data generating means 504 forgenerating request data to read physical blocks of compressed oruncompressed data from a physical sector address corresponding to alogic sector address from the host computer 51, on the magnetoopticaldisk D, a read requesting means 505 for outputting read request datagenerated by the read request data generating means 504 to the systemcontroller 166, an expanded data storing means 506 for storing expandeddata outputted from the data expansion circuit into a given storage areaof the data RAM, a transfer requesting means 507 for transferring data,either expanded or unexpanded, read from the magnetooptical disk D, andan error processing means 508 for processing an error if there is nophysical sector address corresponding to a logic sector address from thehost computer 51.

According to the reading means 501, i.e., the reading subroutine, asshown in FIG. 39, the decision means 502 determines, in a step SD01,whether the magnetooptical disk D loaded in the external memory device52 has been initialized or not based on whether the 1-byte data of thethird byte in the attribute data stored in the attribute data storagearea is "01" or not.

If the 1-byte data is "01" indicating that the magnetooptical disk D hasbeen initialized, control goes to a next step SD02 in which the datareceiving means 503 receives read request data supplied from the hostcomputer 51. The read request data is composed of an identification codeindicative of a read request, a read starting sector address (startinglogic sector address), and a write data length (100 sectors in thisexample).

In a next step SD03, the index register i is initialized, i.e., aninitial value "0" is stored in the index register i.

In a next step SD04, a record corresponding to the value of the indexregister i of the file allocation table FAT is selected among theattribute data stored in the attribute data storage area of the data RAM174.

In a next step SD05, the decision means 502 determines whether the logicsector address stored in the starting logic sector address storage area"a" of the selected record is the same as the logic sector address readin the step SD02.

If these logic sector addresses are not the same as each other, thencontrol proceeds to a step SD06 in which the value of the index registeri is incremented by +1. In a next step SD07, the decision means 502determines whether the search process is finished or not based onwhether the value of the index register i is the same as the finalrecord number N of the file allocation table FAT or not. If the value ofthe index register i is smaller than the final record number N, thencontrol returns to the step SD04 in which a next record is selected inthe file allocation table FAT, and it is determined whether acorresponding address is stored in the starting logic sector addressstorage area "a" of the selected record. This process is repeatedlycarried out until a corresponding address is found. If a correspondingaddress is not found when the value of the index register i reaches thefinal record number N, then control goes to a step SD08 in which theerror processing means 508 effects an error process, and ends thereading subroutine shown in FIG. 39.

The error process may specifically be carried out by transferringmessage data for indicating that no data can be read to the operator tothe host computer 51, and displaying a message "DATA CANNOT BE READ" tothe display unit connected to the host computer 51, thereby indicatingto the operator that new data cannot be read from the presently loadedmagnetooptical disk D.

If a corresponding address is found in the step SD05, control proceedsto a step SD09 in which the read request data generating means 504generates read request data to read data of one physical block from anaddress corresponding to the logic sector address on the magnetoopticaldisk D. Specifically, read request data is generated in which there arerecorded an identification code indicative of a read request, a readstarting sector address, and a read data length.

An absolute sector address is registered as the read starting sectoraddress. Specifically, an absolute sector address which is produced byadding the number of starting sectors (3 tracks×the number (25) ofsectors in a track=75 sectors) of the user area UE to the physicalsector address stored in the starting physical sector address storagearea "c" of the selected record in the file allocation file FAT, isregistered as the read starting sector address, and the number m ofsectors of one physical sector is registered as the read data length.

In a next step SD10, the read request means 505 transfers the readrequest data through the interface 167 to the system controller 166.

Based on the read request data from the data processing apparatus 1, thesystem controller 166 controls the servo controller 165 and variousmechanisms, and reads, through the optical pickup 152, compressed oruncompressed data of one physical block (m sectors) from an addressindicated by the read starting sector address contained in the readrequest data on the magnetooptical disk D, and supplies the read data ofone physical block through the interface 167 to the data processingapparatus 1.

According to the reading subroutine, the read data of one physical blocksent from the system controller 166 is stored into the data storage areaallotted to the data RAM 174 in a step SD11.

In a next step SD12, the decision means 502 determines whether a linkaddress exists or not based on whether there is a link address in thelink address storage area "e" of the ith record selected in the stepSD04. If there is a link address, then control proceeds to a step SD13in which a next record is selected. Thereafter, control returns to thestep SD09, and the step SD09 and following steps are executed.Specifically, data of one physical block is read from the physicalsector address stored in the starting physical sector address storagearea "c" of the record selected in the step SD13 on the magnetoopticaldisk D is read and stored into an empty area of the data storage areaallotted to the data RAM 174.

The above process is repeatedly carried out until it is determined inthe step SC12 that there is no link address in the link address storagearea "e" of the selected record.

When it is determined that there is no link address, control proceeds toa step SD14 in which the decision means 502 determines whether thepresently read data is compressed data or not based on whether the last1-byte data of 3-byte data stored in the link address storage area "e"of the selected final record is "01" or not.

If the last 1-byte data is "01", then control goes to a next step SD15in which the read data stored in the data storage area is outputted tothe data expansion circuit 180. The data expansion circuit 180 effects aloss-less data expanding process on the supplied data using the buffermemory 179 in a step SD16.

In a next step SD17, the expanded data storing means 506 stores theexpanded data from the data expansion circuit 180 into the expanded datastorage area of the data RAM 174.

In a next step SD18, the transfer requesting means 507 outputs atransfer request to transfer the expanded data to the host computer 51.Specifically, transfer request data is generated by adding the expandeddata to a header in which there are registered an identification codeindicative of a transfer request, a destination starting sector address,and a transfer data length.

A logic sector address stored in the starting logic sector addressstorage area "a" of the record in the file allocation table FAT whichhas been selected in the step SD04 is registered as the destinationstarting sector address, and the number of sectors of one logic block isregistered as the transfer data length.

The generated transfer request data is transferred through the interface168 to the host computer 51, whereupon the reading subroutine isfinished. Based on the transfer request data from the data processingapparatus 1, the host computer 51 reads the destination starting sectoraddress from the header of the transfer request data, and thereafterstores the expanded data into an address corresponding to thedestination starting sector address of the data RAM connected throughthe data bus.

If the last 1-byte data is "00" in the step SD14, then control goes to anext step SD19 in which the transfer requesting means 507 outputs atransfer request to transfer the unexpanded data (data sent directlyfrom the system controller 166) to the host computer 51. Specifically,transfer request data is generated by adding the unexpanded data (thedata from the system controller 166 which has been stored into the datastorage area of the data RAM 174 by the data receiving means 503 in thestep SD11) to a header in which there are registered an identificationcode indicative of a transfer request, a destination starting sectoraddress, and a transfer data length.

A logic sector address stored in the starting logic sector addressstorage area "a" of the record in the file allocation table FAT whichhas been selected in the step SD04 is registered as the destinationstarting sector address, and the number of sectors of one logic block isregistered as the transfer data length.

The generated transfer request data is transferred through the interface168 to the host computer 51, whereupon the reading subroutine isfinished. Based on the transfer request data from the data processingapparatus 1, the host computer 51 reads the destination starting sectoraddress from the header of the transfer request data, and thereafterstores the unexpanded data into an address corresponding to thedestination starting sector address of the data RAM (not shown)connected through the data bus.

If the presently loaded magnetooptical disk D has not been initializedin the step SD01, then, as with the step S408 in the main routine shownin FIG. 25, message data representing an initialization prompt istransferred to the host computer 51. The host computer 51 then displaysa message "INITIALIZE DISK" on the display unit connected thereto,indicating to the operator that the presently loaded magnetooptical diskD has not been initialized.

If the request from the host computer 51 is not a reading request in thestep S605 shown in FIG. 28, then control goes to a step S607 in whichthe decision means 210 (see FIG. 24) determines whether the request fromthe host computer 51 is a data deleting request or not.

If the request from the host computer 51 is a data deleting request,then control goes to a step S608, entering a data deleting subroutinewhich is the data deleting means 601.

As shown in FIG. 40, the data deleting means 601 has, in addition to theattribute data writing means 308 (see FIG. 29), a decision means 602 formaking various decisions, a data receiving means 603 for receiving datadeletion request data supplied from the host computer 51 through theinterface 168 to the input port 175, a bit address calculating means 604for calculating a bit address on the record status table of a physicalsector address corresponding to a logic sector address from the hostcomputer 51, a record initializing means 605 for initializing a recordcorresponding to the logic sector address of the file allocation tableFAT, and an error processing means 606 for processing an error if thereis no physical sector address corresponding to a logic sector address.

According to the data deleting means 601, i.e., the data deletingsubroutine, as shown in FIG. 41, the decision means 602 determines, in astep SE01, whether the magnetooptical disk D loaded in the externalmemory device 52 has been initialized or not based on whether the 1-bytedata of the third byte in the attribute data stored in the attributedata storage area is "01" or not.

If the 1-byte data is "01" indicating that the magnetooptical disk D hasbeen initialized, control goes to a next step SE02 in which the datareceiving means 603 reads data deletion request data supplied from thehost computer 51. The data deletion request data is composed of anidentification code indicative of a data deletion request, a datadeletion starting sector address (starting logic sector address), and adeletion data length (100 sectors in this example).

In a next step SE03, the index register i is initialized, i.e., aninitial value "0" is stored in the index register i.

In a next step SE04, a record corresponding to the value of the indexregister i of the file allocation table FAT is selected among theattribute data stored in the attribute data storage area of the data RAM174.

In a next step SE05, the decision means 602 determines whether the logicsector address stored in the starting logic sector address storage area"a" of the selected record is the same as the logic sector addressreceived in the step SE02.

If these logic sector addresses are not the same as each other, thencontrol proceeds to a step SE06 in which the value of the index registeri is incremented by +1. In a next step SE07, the decision means 602determines whether the search process is finished or not based onwhether the value of the index register i is the same as the finalrecord number N of the file allocation table FAT or not. If the value ofthe index register i is smaller than the final record number N, thencontrol returns to the step SE04 in which a next record is selected inthe file allocation table FAT, and it is determined whether acorresponding address is stored in the starting logic sector addressstorage area "a" of the selected record. This process is repeatedlycarried out until a corresponding address is found. If a correspondingaddress is not found when the value of the index register i reaches thefinal record number N, then control goes to a step SE08 in which theerror processing means 606 effects an error process, and ends the datadeleting subroutine shown in FIG. 41.

The error process may specifically be carried out by transferringmessage data for indicating that no data can be deleted to the operatorto the host computer 51, and displaying a message "DATA CANNOT BEDELETED" to the display unit connected to the host computer 51, therebyindicating to the operator that there is no data which can be deletedfrom the presently loaded magnetooptical disk D.

If a corresponding address is found in the step SE05, control proceedsto a step SE09 in which the bit address calculating means 604 reads aphysical sector address from the starting physical sector addressstorage area "c" of the selected record, and calculates a bit address"b" corresponding to the physical sector address in the string of bitsmaking up the record status table. The bit address "b" is calculatedaccording to b=S/m where S is the physical sector address and m is thenumber of sectors of one physical block.

In a next step SE10, a bit corresponding to the bit address "b"calculated by the bit address calculating means 604 in the string ofbits making up the record status table is set to "1". That is, bitsetting processing is carried out.

In a next step SE11, the decision means 602 determines whether a linkaddress exists or not based on whether a link address is stored in thelink address storage area "e" of the record selected in the step SE04.If there is a link address, then control proceeds to a step SE12 inwhich a next record is selected. In a next step SE13, the recordinitializing means 605 initializes the preceding record, i.e., "0" isstored into the preceding record.

Thereafter, control returns to the step SE09, and the step SD09 andfollowing steps are executed. Specifically, a physical sector address isread from the starting physical sector address storage area "c" of therecord selected in the step SE12, a bit address of the record statustable corresponding to the physical sector address is calculated, and abit corresponding to the bit address "b" obtained by the above bitaddress calculation in the string of bits making up the record statustable is set to "0".

The above process is repeatedly carried out until it is determined inthe step SE11 that there is no link address in the link address storagearea "e" of the selected record. When it is determined that there is nolink address in the step SE11, control goes to a step SE14 in which therecord initializing means 605 initializes the presently selected record,i.e., "0" is stored into the presently selected record.

In a next step SE15, control enters an attribute data writing subroutinewhich is the attribute data writing means 308. Since this attribute datawriting subroutine is the same as the attribute data writing subroutineshown in FIG. 31, details of the attribute data writing subroutine willnot be described below except that updated attribute data of 3 sectorsstored in the attribute data storage area of the data RAM 174 isrecorded in the sectors 0-2 of the track 0, the sectors 12-14 of thetrack 1, the sectors 0-2 of the track 9997, and the sectors 12-14 of thetrack 9998 on the magnetooptical disk D.

When the attribute data writing subroutine is finished, the datadeleting subroutine is also finished.

If the presently loaded magnetooptical disk D has not been initializedin the step SE01, then as with the step S408 in the main routine shownin FIG. 25, message data representing an initialization prompt istransferred to the host computer 51. The host computer 51 then displaysa message "INITIALIZE DISK" on the display unit connected thereto,indicating to the operator that the presently loaded magnetooptical diskD has not been initialized.

If the request from the host computer 51 is not a data deleting request,then control goes to a step S609, other processing is carried outdepending on a request from the host computer 51.

Referring back to the main routine shown in FIG. 25, the decision means202 determines, in a next step S411, whether a disk unloading requesthas been inputted or not based on whether an internal interrupt signalgenerated by a command input which corresponds to a disk unloadingrequest and is applied to the key input means such as a keyboardconnected to the host computer 51, or by operation of a disk unloadingkey on a control panel mounted on an outer casing of the external memorydevice 52, is supplied through the input port 175 or not.

If no internal interrupt signal is supplied, indicating that there is nodisk unloading request, then control returns to the step S409, waitingfor a next processing request from the host computer 51. If an internalinterrupt signal is supplied, indicating that there is a disk unloadingrequest, then control proceeds to the step S412 in which a diskunloading request is outputted to the system controller 166 through theoutput port 176 and the interface 167.

Based on a disk unloading request signal from the data processingapparatus 1, the system controller 166 controls a disk loading mechanismin the external memory device 52 to move the magnetooptical disk Dmounted on the turntable 154 on the spindle motor 151 to an unloadingslot, which doubles as a loading slot, i.e., to a position where theoperator can easily remove the magnetooptical disk D out of the externalmemory device 52. At this time, the process of unloading themagnetooptical disk D is finished.

Then, the decision means 202 determines, in a step S413, whether thereis a program finishing request or not based on whether there is afinishing request interrupt input such as a power supply turn-off input.

If there is no program finishing request in the step S413, then controlreturns to the step S403 to wait for the loading of a nextmagnetooptical disk D. If there is a program finishing request in thestep S413, then the data processing program 201 comes to an end.

Two other preferable functions that are added to the data processingapparatus according to the third embodiment will be described below.

The first function is to indicate a remaining data recording capacity ofthe magnetooptical disk D to the host computer 51.

Specifically, when a read capacity request command for confirming aremaining data recording capacity of the magnetooptical disk D isinputted from the host computer 51 to the data processing apparatus 1,the CPU 181 can usually calculate a remaining data recording capacity,or stated otherwise, an unrecorded physical data recording capacityrepresented by X KB! or XKB, by subtracting used physical sectoraddresses obtained by referring to data management information on themagnetooptical disk D of the file allocation table FAT stored in theattribute data storage area of the data RAM 174, from a known entiredata recording size in the user area UE, which may be calculated fromdata (the number of tracks in the user area UE and the number of sectorsper track) recorded as pre-pits in a suitable area on the magnetoopticaldisk D.

Then, the equation: the expected compression ratio β×the remainingphysical data recording capacity X=the remaining logic data recordingcapacity Y is calculated to indicate the resulting remaining logic datarecording capacity Y=β·X KB! to the host computer 51.

The host computer 51 can now recognize at present that at most as muchdata as the remaining logic data recording capacity Y can be recorded onthe magnetooptical disk D.

According to the loss-less data compression technique, however, theactual compression ratio ε for data compression is not constant, butcannot accurately be determined unless data is compressed. If theremaining data recording capacity of the magnetooptical disk D ismanaged as (β·X=Y), when data of the same capacity (the same length) asthe remaining maximum pre-compression data Y is transferred to the dataprocessing apparatus, the transferred pre-compression data may not berecorded in its entirety, either compressed or uncompressed, on themagnetooptical disk D provided the actual compression ratio ε of thedata is smaller than the expected compression ratio β.

To avoid the above situation, a special recording area is provided onthe magnetooptical disk D for recording an overflow of data producedafter the data is compressed if the actual compression ratio e of thedata is smaller than the expected compression ratio β and when the datalength of the compressed data is equal to or greater than the remainingphysical data recording capacity X. The special recording area comprisesa recording area composed of 100 sectors back from the sector 24 of thefinal track 9947 of the user area UE, for example. These 100 sectors aresubtracted from the remaining physical data recording capacity X whenthe remaining logic recording capacity Y is calculated in the CPU of thedata processing apparatus. The area of the 100 sectors is a recordingarea (capacity) that is concealed from the host computer 51.

The alternate area AE is usually designed to leave a sufficient areaeven when the user area UE is used in its entirety. Therefore, the aboveconcealed recording area may comprise such an extra area left in thealternate area AE, thereby preventing the recording capacity of the userarea UE from being reduced.

According to another technique to avoid a situation in which thetransferred pre-compression data Y may not be recorded in its entirety,either compressed or uncompressed, on the magnetooptical disk D, when aread capacity request command is inputted from the host computer 51, anapparent logic data recording capacity with the expected compressionratio β reduced depending on a reduction in the physical unrecorded datarecording capacity on the magnetooptical disk D may be reported to thehost computer 51.

FIG. 42 illustrates such another technique. As shown in FIG. 42, theexpected compression ratio β is β=2 when the physical unrecorded datacapacity Y ranges from a maximum recording capacity to a certain value,and is gradually reduced when the physical unrecorded data capacity Yranges from the certain value to a physical unrecorded data capacity 0.For example, if the physical unrecorded data capacity Y is 10 MB, thenit may be reported to the host computer 19 that the physical unrecordeddata capacity Y is 20 MB, and if the physical unrecorded data capacity Yis 1 MB, then it may be reported to the host computer 19 that thephysical unrecorded data capacity Y is 1.5 MB. In this manner, even whenmaximum data of the remaining physical unrecorded data capacity Y issent from the host computer 51, the possibility that the compressed datawill overflow the recordable area on the magnetooptical disk D can bereduced.

An actual compression ratio ε calculated when data is compressed may bestored, and the value of the expected compression ratio β may bereplaced with the stored actual compression ratio ε in a next accessingcycle. The expected compression ratio β may also be recorded in the DDSsector of the magnetooptical disk D, and updated.

The other function is to rearrange mutually related data randomlyrecorded in physical blocks on the magnetooptical disk D into data thatare successively arranged in physical blocks.

In the above example, according to the writing means (writingsubroutine) 400, particularly the processing routine from the stepsSA05-SA15 shown in FIGS. 34 and 35, i.e., the processing routineexecuted by the random individual record searching means 409, when dataof one logic block is compressed into compressed data of two or morephysical blocks by the data compression circuit 178, if there are notfound successive areas, i.e., as many successive areas as the number ofproduced physical blocks, for recording the compressed data oruncompressed data, then the data are randomly recorded in units of onephysical block at physical sector addresses where no data has beenrecorded.

Therefore, the mutually related data are recorded separately atpositions spaced from each other on the magnetooptical disk D. In thiscase, when the data are to be read from the magnetooptical disk D, theprocess of seeking the data is time-consuming, resulting in an increasedaccess time.

According to this embodiment, no branching process is carried out by therequest processing means 204 in the data processing means 201, but arearranging program is incorporated which is started periodically orirregularly by the OS in the absence of an access request from the hostcomputer 51. The rearranging program will be described below.

It is assumed that write data of one logic block represented by thelogic sector addresses 4900-4999 is divided into uncompressed data of 50sectors beginning from the physical sector address 2000 and uncompresseddata of 50 sectors beginning from the physical sector address 3560. Inthe absence of an access request from the host computer 51, therearranging program refers to the file allocation table FAT, andarranges the positions where the block data are separately recorded.

Specifically, if the physical sector addresses 2050-2099 become empty,the uncompressed data at the physical addresses 3561-4110 is shifted tothe empty physical sector addresses. Alternatively, the 100 sectors,i.e., the 50 sectors at the physical sector addresses 2000-2049 and the50 sectors at the physical sector addresses 3560-4109, of theuncompressed data may be shifted to a completely different datarecording position.

When there is a request from the host computer 51 to read data of onelogic block, therefore, since data of two physical blocks correspondingto the data of one logic block are successively recorded on themagnetooptical disk D, the process of seeking the data is prevented frombeing excessively time-consuming, and the access time can greatly beshortened.

In the data processing apparatus (data transmitting apparatus) 1according to the third embodiment which is incorporated in the externalmemory device 52, therefore, the data processing means 201 searches theattribute data recorded in the attribute data recording areas of themagnetooptical disk D, i.e., the record status of physical blocks ofdata recorded in the user area UE based on the file allocation tableFAT, to generate a record status table of 1 bits(1/0=recorded/unrecorded) each for one physical block. Therefore, whenthere is a data writing request from the host computer 51, the writingmeans (writing subroutine) 401 searches the statuses of the bits of abit string making up the record status table to determine at whichphysical sector address data is to be recorded. Consequently, the searchtime can be made shorter than if physical sector addresses stored in thestarting physical sector address storage area "c" of the file allocationtable FAT were directly searched. Since the record statuses can berecognized by simple bits of 1/0, the time required for programdebugging, system maintenance, etc. is shorter than if the recordstatuses were recognized from physical sector addresses having a complexbit arrangement in data structure.

According to the third embodiment, furthermore, in the writing means401, when data of one block from the host computer 51 is compressed bythe data compression circuit 178, if the data length of the compresseddata is equal to or less than the number of sectors of one physicalblock and the actual compression ratio E is equal to or greater thanβ/(β-1), then the data compressed by the data compression circuit 178 isrecorded on the magnetooptical disk D, and if the actual compressionratio ε is in the range of 0<ε<β/(β-1), i.e., if the data length (thenumber of physical blocks) of the data compressed by the datacompression circuit 178 is substantially equal to or greater than onelogic block, then data (uncompressed data) directly supplied from thehost computer 51 is recorded on the magnetooptical disk D. Consequently,the recorded data with its actual compression ratio ε being in the rangeof 0<ε<β/(β-1), among the data recorded on the magnetooptical disk D, isnot required to be expanded, so that the speed at which the data is readfrom the magnetooptical disk D can be increased for increasedperformance of the external memory device.

The above process needs new information for distinguishing compresseddata and uncompressed data from each other. According to the presentembodiment, decision data for distinguishing compressed data anduncompressed data from each other is stored together with informationindicative of no link address in the link address storage area "e" ofthe file allocation table FAT. Therefore, it is not necessary to keep astorage area for registering the decision data on the magnetoopticaldisk D, with the result that the problem of a reduced data recordingcapacity is alleviated.

According to this embodiment, furthermore, for recording data over twoor more physical blocks, the writing means 401 has the random successiverecord searching means 410 for searching for successive recording areasto record these data over two or more physical blocks and registeringthe recording areas in the file allocation table FAT. Accordingly, thedata over two or more physical blocks are prevented from being recordedin physically spaced positions, and the seek time for reading data caneffectively be shortened.

In the above embodiments, the present invention is applied to rewritablemagnetooptical (MO) disks. However, the principles of the presentinvention are also applicable to hard disks which comprise magneticdisks. If the principles of the present invention are applied to a WORM(write-once read-multiple) disk where data can be written only once,then data can be shifted to a completely different recording position.However, when data is shifted to a completely different recordingposition on the WORM disk, the data recording capacity available on theWORM disk is reduced. Therefore, this data shifting process is usuallynot carried out though it may be effected. The present invention can beapplied to a technique to record the file allocation table FAT on themagnetooptical disk D.

We claim:
 1. An apparatus for transmitting data,comprising:pre-compression data holding means for holdingpre-compression data; data compressing means for compressing thepre-compression data held by the pre-compression data holding means;compressed data holding means for holding compressed data from the datacompressing means; decision means for determining data to betransmitted, based on data lengths of the pre-compression data and thecompressed data and a preset condition; and data transmitting means fortransmitting either one of the pre-compression data held by thepre-compression data holding means and the compressed data held by thecompressed data holding means, based upon decision results from thedecision means, wherein the decision means carries out a decisionprocess based on an actual compression ratio of the data length of thepre-compression data to the data length of the compressed data and apreset compression ratio outputs decision results indicating the data tobe transmitted as the compressed data if the actual compression ratio isat least the preset compression ratio, and outputs decision resultsindicating the data to be transmitted as the pre-compression data if theactual compression ratio is smaller than the preset compression ratio.2. An apparatus according to claim 1, wherein the decision means carriesout a decision process based on an actual difference between the datalengths of the pre-compression data and the compressed data and a presetdifference, outputs decision results indicating the data to betransmitted as the compressed data if the actual difference is at leastthe preset difference, and output decision results indicating the datato be transmitted as the pre-compression data if the actual differenceis smaller than the preset difference.
 3. An apparatus according toclaim 1, wherein the decision means outputs decision results indicatingthe data to be transmitted as the compressed data if an actualdifference between the data lengths of the pre-compression data and thecompressed data is at least a preset difference and also if an actualcompression ratio of the data length of the pre-compression data to thedata length of the compressed data is at least a preset compressionratio, and outputs decision results indicating the data to betransmitted as the pre-compression data otherwise.
 4. An apparatusaccording to claim 1, wherein the decision means determines whether anactual compression ratio of the data length of the pre-compression datato the data length of the compressed data satisfies either one of twopreset conditions, outputs decision results indicating the data to betransmitted as the pre-compression data if the actual compression ratiosatisfies one of the two conditions, and outputs decision resultsindicating the data to be transmitted as the compressed data if theactual compression ratio satisfies the other of the two conditions. 5.An apparatus according to claim 4, wherein the one of the two conditionsis 0<the actual compression ratio ε<β(β-1) and the other of the twoconditions is the actual compression ratio ε≦β(β-1) where β is acompression ratio to be expected when the pre-compression data iscompressed.
 6. An apparatus according to claim 2, further comprisingpreset value changing means for changing the preset compression ratio orthe preset difference and the preset compression ratio and the presetdifference to optional values.
 7. An apparatus according to claim 1,wherein the pre-compression data comprises data supplied from anexternal source.
 8. An apparatus according to claim 1, wherein the datatransmitting means transmits the pre-compression data or the compresseddata to data recording means for recording data on a recording medium.9. An apparatus for transmitting data, comprising:pre-compression dataholding means for holding pre-compression data; data compressing meansfor compressing the pre-compression data held by the pre-compressiondata holding means in units of a predetermined data length; compresseddata holding means for holding compressed data from the data compressingmeans; decision means for determining data to be transmitted, based on adata length of partial compresses data produced by compressing a portionof the pre-compression data with the data compressing means, a datalength of the portion of the pre-compression data, and a presetcondition; and data transmitting means for transmitting either one ofthe pre-compression data held by the pre-compression data holding meansand the compressed data held by the compressed data holding means, basedupon decision results from the decision means, wherein the decisionmeans carries out a decision process based on a predicted compressionratio of the data length of the portion of the pre-compression data tothe data length of the partial compressed data, and a preset compressionratio, outputs decision results indicating the data to be transmitted asthe compressed data if the predicted compression ratio is at least thepreset compression ratio, and outputs decision results indicating thedata to be transmitted as the pre-compression data if the predictedcompression ratio is smaller than the preset compression ratio.
 10. Anapparatus according to claim 9, further comprising data deleting meansfor successively deleting the pre-compression data compressed by thedata compressing means.
 11. An apparatus according to claim 9, whereinthe data compressing means stops compressing the pre-compression dataafter the portion of the pre-compression data is compressed when thedecision results from the decision means indicate the data to betransmitted as the pre-compression data.
 12. An apparatus according toclaim 9, further comprising weighting means for weighting the predictedcompression ratio depending on the type of data.
 13. An apparatusaccording to claim 9, further comprising preset value changing means forchanging the preset compression ratio to an optional value.
 14. Anapparatus according to claim 9, wherein the pre-compression datacomprises data supplied from an external source.
 15. An apparatusaccording to claim 9, wherein the data transmitting means transmits thepre-compression data or the compressed data to data recording means forrecording data on a recording medium.
 16. A method for transmittingdata, comprising the steps of:determining data to be transmitted, basedon a data length of a pre-compression data which is held, a data lengthof compressed data produced by compressing the pre-compression data anda preset condition; and transmitting either one of the pre-compressiondata and the compressed data based upon decision results, wherein thestep of determining is carried out based on an actual compression ratioof the data length of the pre-compression data to the data length of thecompressed data and a preset compression ratio, and wherein thecompressed data is transmitted if the actual compression ratio is atleast the preset compression ratio, and the pre-compression data istransmitted if the actual compression ratio is smaller than the presetcompression ratio.
 17. A method according to claim 16, wherein the stepof determining is carried out based on an actual difference between thedata lengths of the pre-compression data and the compressed data and apreset difference, and wherein the compressed data is transmitted if theactual difference is at least the preset difference, and thepre-compression data is transmitted if the actual difference is smallerthan the preset difference.
 18. A method according to claim 16, whereinthe the compressed data is transmitted if the decision results indicatethat an actual difference between the data lengths of thepre-compression data and the compressed data is at least a presetdifference and also that an actual compression ratio of the data lengthof the pre-compression data to the data length of the compressed data isat least a preset compression ratio, and the pre-compression data istransmitted otherwise.
 19. A method according to claim 16, wherein thestep of determining is carried out depending on whether an actualcompression ratio of the data length of the pre-compression data to thedata length of the compressed data satisfies either one of two presetconditions, and wherein the pre-compression data is transmitted if theactual compression ratio satisfies one of the two conditions, and thecompressed data is transmitted if the actual compression ratio satisfiesthe other of the two conditions.
 20. A method according to claim 19,wherein the one of the two conditions is 0<the actual compression ratioε<β(β-1) and the other of the two conditions is the actual compressionratio ε≧β(β-1) where β is a compression ratio to be expected when thepre-compression data is compressed.
 21. A method according to claim 17,wherein the preset compression ratio or the preset difference and thepreset compression ratio and the preset difference can be changed tooptional values.
 22. A method according to claim 16, wherein thepre-compression data comprises data supplied from an external source.23. A method according to claim 16, wherein the pre-compression data orthe compressed data is transmitted to data recording means for recordingdata on a recording medium.
 24. A method for transmitting data,comprising the steps of:determining data to be transmitted, based on adata length of partial compressed data which is produced by compressinga portion of pre-compression data which is held, a data length of theportion of the pre-compression data, and a preset condition; andtransmitting either one of the pre-compression data and the compresseddata based upon decision results, wherein the step of determining iscarried out based on a predicted compression ratio of the data length ofthe portion of the pre-compression data to the data length of thepartial compressed data, and a preset compression ratio, and wherein thecompressed data is transmitted if the predicted compression ratio is atleast the preset compression ratio, and the pre-compression data istransmitted if the Predicted compression ratio is smaller than thepreset compression ratio.
 25. A method according to claim 24, whereinthe compressed portion of the pre-compression data is successivelydeleted.
 26. A method according to claim 24, wherein the pre-compressiondata is not compressed after the portion of the pre-compression data iscompressed when the decision results indicate that the data to betransmitted is the pre-compression data.
 27. A method according to claim24, wherein the predicted compression ratio is weighted depending on thetype of data.
 28. A method according to claim 24, wherein the presetcompression ratio can be changed to an optional value.
 29. A methodaccording to claim 24, wherein the pre-compression data comprises datasupplied from an external source.
 30. A method according to claim 24,wherein the pre-compression data or the compressed data is transmittedto data recording means for recording data on a recording medium.